home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / THINK C Digest / 1994 / 94-03 < prev    next >
Text File  |  1995-12-31  |  139KB  |  4,376 lines

  1. 
  2. Path: ucivax!gateway
  3. From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
  4. Subject: Re: CDLOGDialog behavior
  5. Message-ID: <9402281817.aa18638@q2.ics.uci.edu>
  6. In-Reply-To: <9402162203.aa22070@q2.ics.uci.edu>
  7. Content-Type: TEXT/PLAIN; charset=US-ASCII
  8. MIME-Version: 1.0
  9. Newsgroups: fa.think-c
  10. X-Message-ID: <Pine.3.07.9402281900.C27992-b100000@u.cc.utah.edu>
  11. Approved: usenet@q2.ics.uci.edu
  12. Lines: 30
  13. Date: 1 Mar 94 02:17:23 GMT
  14.  
  15. > Hmmm... I would say that it is definitely worth the effort to learn to
  16. > program object-oriented code well.  This will make you a better C or
  17. > pascal programmer.  I also think that one can write good object oriented
  18.  
  19. > I feel that the jury is still out on object-oriented programming.  I also
  20. > have a low regard for C++ in particular.  I believe that it was an error
  21. > to require that the same linker be used for C++ as for C.  The language
  22. > would have been a lot cleaner if one could compile into object code
  23. > that would carry semantic information into library files (no need for
  24. > name mangling, etc.)  There are other gripes I have with it, but I do
  25. > not recall them now.
  26. >
  27.  
  28.  
  29. Actually, OOP can come or go OOD is where the real magic is. The whole
  30. point of OOD is to keep the end-user in the design and engineering part of
  31. the project for as long as possible.
  32.  
  33. Your argument about the name mangler is unfounded. First the linke needs
  34. to link Assembly, Pascal, C, C++, and any other language that you have
  35. available in you Dev Enviroment; so there needs to be a consistent naming
  36. convention. Plus in all the time that I have been programming I have never
  37. had to debug a linker, so I have never seen the name mangling going on
  38. (though I do know about it). Also, if the compiler is doing its job
  39. correctly then the problem of MacsBug's names being mangled should not even
  40. exists. I believe Symantec C++ does not mangle those names.
  41.  
  42. Lance
  43.  
  44.  
  45. 
  46. 
  47. Path: ucivax!gateway
  48. From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
  49. Subject: Re: Modeless Dialog Source
  50. Message-ID: <9402281838.aa19798@q2.ics.uci.edu>
  51. In-Reply-To: <9402191059.aa10251@q2.ics.uci.edu>
  52. Content-Type: TEXT/PLAIN; charset=US-ASCII
  53. MIME-Version: 1.0
  54. Newsgroups: fa.think-c
  55. X-Message-ID: <Pine.3.07.9402281911.F27992-b100000@u.cc.utah.edu>
  56. Approved: usenet@q2.ics.uci.edu
  57. Lines: 28
  58. Date: 1 Mar 94 02:38:28 GMT
  59.  
  60. > I'm looking for solid, commented Modeless Dialog source code. My code *does*
  61. > work, but I want to check it against an established skeleton. I also have
  62. > a number of questions.
  63.  
  64. The way to handle a Modeless dialog is identical to a document window. But
  65. you may need to put in your own event loop to handle the box.
  66.  
  67. >
  68. > One question I would like answered is how people handle text boxes that are
  69. > supposed to contain only integers. Do you preprocess key presses? Do you
  70. > do a check before the dialog closes? Do you allow keys into DialogSelect,
  71. > and then validate the text box immediately afterward?
  72.  
  73. I always validate the keys that I will allow into a TEBox before I put it
  74. there and if the user does press a non-allowed key then I beep at him.
  75. Also, if the user keeps pressing keys then he may get confused so after a
  76. couple of tries you could bring up an Alert informing him of the problem
  77. (Check IM Dialog manager on alert stages).
  78.  
  79. If you do a check before the dialog closes then the user is not
  80. getting immediate feedback when keys are pressed (which is a no-no on UI
  81. guidlines). If you validate the TEBox that is giving immediate feedback
  82. but it does not look clean; the update on the box could confuse the user
  83. if he didn't see the change.
  84.  
  85. Lance
  86.  
  87.  
  88. 
  89. 
  90. Path: ucivax!gateway
  91. From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
  92. Subject: Re: GetDateTime()
  93. Message-ID: <9402281843.aa20117@q2.ics.uci.edu>
  94. In-Reply-To: <9402241141.aa12199@q2.ics.uci.edu>
  95. Content-Type: TEXT/PLAIN; charset=US-ASCII
  96. MIME-Version: 1.0
  97. Newsgroups: fa.think-c
  98. X-Message-ID: <Pine.3.07.9402281940.I27992-9100000@u.cc.utah.edu>
  99. Approved: usenet@q2.ics.uci.edu
  100. Lines: 16
  101. Date: 1 Mar 94 02:43:03 GMT
  102.  
  103. Shawn,
  104.  
  105. > Have you guys thought of using the tick counter as the source
  106. > of your random seed number?  That is what I use, and it works
  107. > quit well.
  108. >
  109.  
  110.  
  111. Apple does not recommend using tick counter any more. The better approach
  112. is to get the date time. This also applies to timing events as well, since
  113. Apple does not garentee (Misspelling I know :( ) that there are 60
  114. ticks/second on new machines.
  115.  
  116. Lance
  117.  
  118.  
  119. 
  120. 
  121. Path: ucivax!gateway
  122. From: G.POLDER@cpro.agro.nl
  123. Subject: default folder for SFGetFile
  124. Message-ID: <9403010323.aa17547@q2.ics.uci.edu>
  125. Content-transfer-encoding: 7BIT
  126. Newsgroups: fa.think-c
  127. X-Message-ID: <9403011123.AA13768@ganges.cpro.agro.nl.agro.nl>
  128. Approved: usenet@q2.ics.uci.edu
  129. Lines: 4
  130. Date: 1 Mar 94 11:23:23 GMT
  131. X-Envelope-to: think-c@ics.uci.EDU
  132.  
  133. How can I start SFGetFile in a certain (default) folder?
  134.  
  135. thanks, Gerrit.
  136. g.polder@cpro.agro.nl
  137. 
  138. 
  139. Path: ucivax!gateway
  140. From: walrathw@rferl.org (WalrathW)
  141. Subject: ToneDial Src Upload
  142. Message-ID: <9403010601.aa07463@q2.ics.uci.edu>
  143. Content-transfer-encoding: 7BIT
  144. Content-type: TEXT/PLAIN; CHARSET=US-ASCII
  145. Newsgroups: fa.think-c
  146. X-Message-ID: <01H9GN1JWELE8WXFN1@MUVAXA.RFERL.ORG>
  147. Approved: usenet@q2.ics.uci.edu
  148. Lines: 5
  149. Date: 1 Mar 94 14:01:12 GMT
  150.  
  151. I just uploaded C and Pascal source for generating touch tones to
  152. ftpbio.bgsu.edu (Tone_Dialer.sit.hqx).  It's in the incoming directory waiting
  153. to be processed (so snag it from there if you can't wait  ;)  ).
  154.  
  155. -wayne
  156. 
  157. 
  158. Path: ucivax!gateway
  159. From: andy.law@afrc.ac.uk (Big Nose)
  160. Subject: User Procs and event filters in Control Panels
  161. X400-Originator: andy.law@afrc.ac.uk
  162. Content-Identifier: 11830C533100
  163. Message-ID: <9403010929.aa18730@q2.ics.uci.edu>
  164. X400-Recipients: think-c@ics.uci.edu
  165. Sensitivity: Company-Confidential
  166. Newsgroups: fa.think-c
  167. X-Message-ID: <2041261701031994/A08651/IAPE/11830C533100*@MHS>
  168. X400-Received: by mta sun2.mhs-relay.ac.uk in /PRMD=uk.ac/ADMD= /C=gb/; Relayed; Tue, 1 Mar 1994 17:28:32 +0000
  169. X400-Received: by mta arcs.afrc.ac.uk in /PRMD=UK.AC/ADMD= /C=GB/; Relayed; Tue, 1 Mar 1994 17:28:58 +0000
  170. X400-Received: by /PRMD=UK.AC/ADMD= /C=GB/; converted (ia5 text (2)); Relayed; Tue, 1 Mar 1994 17:28:38 +0000
  171. Approved: usenet@q2.ics.uci.edu
  172. X400-Content-Type: P2-1988 (22)
  173. Lines: 24
  174. Date: 1 Mar 94 17:29:38 GMT
  175. X400-MTS-Identifier: [/PRMD=UK.AC/ADMD= /C=GB/;2041261701031994/A08651/IAPE]
  176.  
  177.  
  178. Dear All,
  179.  
  180. I have a control panel that needs to put up a modal dialog box under
  181. certain circumstances. Obviously, I would like to be able to frame
  182. the default button and do some other fancy stuff with event filters.
  183. However, as I understand it, control panels wander around memory
  184. quite a bit, so such routines are likely to cause some amount of
  185. chaos. What is the best way to get around this. The two ideas I've
  186. come up with are (a) Lock the control panel down before doing the
  187. dialog and then unlock it afterwards. or (b) Write the userProcs and
  188. event filters as separate code resources, load them in and lock them
  189. down before doing the dialog and then unlock them again afterwards.
  190.  
  191. It strikes me that (a) is easiest but (b) is cleaner in that only the
  192. necessary bits are locked down.
  193.  
  194. Which is the best (correct) approach, or there a better alternative?
  195.  
  196. Thanks in advance
  197.  
  198. Andy Law
  199.  
  200. ( LAWA @ afrc.ac.uk                       Big Nose in Edinburgh )
  201. 
  202. 
  203. Path: ucivax!gateway
  204. From: wintermyrej@lonexa.admin.rl.af.mil (Jim Wintermyre)
  205. Subject: Re: A question about colors
  206. Message-ID: <9403011134.aa27667@q2.ics.uci.edu>
  207. Newsgroups: fa.think-c
  208. X-Message-ID: <9403011933.AA07855@lonexc.admin.rl.af.mil>
  209. Approved: usenet@q2.ics.uci.edu
  210. Lines: 34
  211. Date: 1 Mar 94 19:34:14 GMT
  212.  
  213. Hi.  I posted a message yesterday about how you sometimes might not be able
  214. to see all the colors in a displayed image even if all the colors are in the
  215. palette.  I need to clarify that.
  216.  
  217. I did not mention that this problem only shows up if you are using CopyBits
  218. to copy from a direct pixel map to an indexed pixel map.  In my case, I had a
  219. 32-bit direct offscreen GWorld, and I was using CopyBits to copy it to an
  220. 8-bit window.  So in the example I gave, the red ramp would show up with only
  221. 16 shades of red, as I described.
  222.  
  223. If instead you have an 8-bit offscreen GWorld, and you fill it with a red
  224. ramp (by simply writing the values of the indices of the red shades in the
  225. palette into the the GWorld buffer), and then display it in an 8-bit window
  226. by using CopyBits, you *don't* see the problem I described.  You see all 256
  227. shades of red (actually 254 + black and white).
  228.  
  229. The reason for this is that in the second case, CopyBits does not have to
  230. convert between bit depths, which is when the inverse table matching method
  231. would normally be invoked.  The inverse table is used whenever QD has to
  232. convert an RGB value into a color table index.  In the first case above, the
  233. pixel values in the 32-bit GWorld pixel map are acutally RGB values, so they
  234. must be converted to the indices of the closest available color in the 8-bit
  235. color table of the display device (where the window is) - thus the inverse
  236. tables are used.  In the second case above, the values in the 8-bit GWorld
  237. pixel map are already color table indices, so no conversion is necessary
  238. (assuming that the color table in the offscreen GWorld is the same as that of
  239. the destination device).
  240.  
  241. I hope this clears up what I said earlier.
  242.  
  243. Jim
  244.  
  245. winter@ai.rl.af.mil
  246. wintermyrej@lonex.rl.af.mil
  247. 
  248. 
  249. Path: ucivax!gateway
  250. From: boudinot@bobby.iaf.cnrs-gif.fr
  251. Subject: Subscription to think-c mailing list
  252. Message-ID: <9403020237.aa20437@q2.ics.uci.edu>
  253. Newsgroups: fa.think-c
  254. X400-Received: by /PRMD=cicb/ADMD=atlas/C=FR/;
  255.  Relayed; 02 Mar 94 11:37:46+0100
  256. X400-Received: by /PRMD=cnrs-gif/ADMD=0/C=fr/;
  257.  Relayed; 02 Mar 94 11:37:25+0100
  258. X-Message-ID: <94030211352589@bobby.iaf.cnrs-gif.fr>
  259. Approved: usenet@q2.ics.uci.edu
  260. X-Vms-To: SMTP%"think-c@ics.uci.edu"
  261. Lines: 3
  262. Date: 2 Mar 94 10:37:47 GMT
  263.  
  264. SUB think-c
  265.  
  266.  
  267. 
  268. 
  269. Path: ucivax!gateway
  270. From: joe@martin.cm.utexas.edu
  271. Subject: Data and Resource Forks
  272. Message-ID: <9403020623.aa12351@q2.ics.uci.edu>
  273. Newsgroups: fa.think-c
  274. X-Message-ID: <9403021420.AA05677@martin.cm.utexas.edu>
  275. Approved: usenet@q2.ics.uci.edu
  276. Lines: 24
  277. Date: 2 Mar 94 14:23:52 GMT
  278.  
  279.  
  280.     We all know that the Mac OS create files with both
  281. data and resource forks. And when one copies files using
  282. Mac applications or the Finder that both forks get copied.
  283. However, when MacMint or other unix-like OS designed to work
  284. on the Mac copies files, only the data fork get copied.
  285.  
  286. Questions: Are the data fork and resource forks actually separate
  287. and different in a low level way at looking at things? That is,
  288. don't both contain binary info so that a command to copy a file
  289. bit by bit would copy the entire file including data, resource, or
  290. any other kind of forks? Is the distinction between resource
  291. and data forks just an OS distinction based on how the OS handle
  292. the info from that file and how it organized the addresses and
  293. pointers to the different forks? Or is this distinction something
  294. more, so that a file named "FOO" actually consist of two files:
  295. "FOO:data" and "FOO:resource" such that MacMint or other unix-like
  296. OS when asked to copy "FOO" would only copy "FOO:data" not
  297. "FOO:data" and "FOO:resource".
  298.  
  299. Is this clear? My apology if this is not.
  300.  
  301. Joe
  302.  
  303. 
  304. 
  305. Path: ucivax!gateway
  306. From: FEATS@vtvm1.cc.vt.edu (Steve Greenfield)
  307. Subject: Finder Icon Editor
  308. Message-ID: <9403020624.aa12365@q2.ics.uci.edu>
  309. Newsgroups: fa.think-c
  310. X-Message-ID: <9403020623.aa12365@q2.ics.uci.edu>
  311. Approved: usenet@q2.ics.uci.edu
  312. Lines: 30
  313. Date: 2 Mar 94 14:24:02 GMT
  314.  
  315. I created a Family of Icons for my application which used a custom RGB
  316. color (R -> 65535, G -> 65270, B -> 35862).  Everything appears fine
  317. except one thing.  According to my ResEdit Reference:
  318.  
  319.      "The display bar area on the far right shows the icon in the
  320.       form of 3 groups of images against the background that was
  321.       selected from the Icons menu (normal, open, offline).  Within
  322.       the display bar area the icons are shown unselected on the
  323.       left and selected on the right."
  324.  
  325. Well, my selected normal icon (right side of display bar area) and my
  326. unselected normal icon (left side of display bar area) were the same.
  327. Other applications that I look at using ResEdit have a Selected normal
  328. icon that is shaded darker than the Unselected normal icon.  When you
  329. single click on other application icons they get darker but when you
  330. single click on mine it stays the same.
  331.  
  332. I finally changed the color in my Icon to an 'Apple Icon Color' (first
  333. selection under the Color menu within the Finder Icon Editor) and then
  334. my Selected normal icon became shaded darker.  Now when I single click
  335. on my Application Icon it gets darker as per other applications.
  336.  
  337. Why, when I use a custom color in my Icon, does the shading not appear
  338. for my selected normal variation?  Is there a way around this apparent
  339. limitation of the Finder Icon Editor under ResEdit 2.1.1?  I want to use
  340. my custom color but I definitely want the darker shading for my selected
  341. normal icon!  Thanks in advance for any advice or explanations!
  342.  
  343.  
  344. /steve greenfield <feats@vtvm1.cc.vt.edu>
  345. 
  346. 
  347. Path: ucivax!gateway
  348. From: tbrown@dorsai.dorsai.org (Tommy Brown)
  349. Subject: Re: Data and Resource Forks
  350. Message-ID: <9403021125.aa01094@q2.ics.uci.edu>
  351. In-Reply-To: <9403020623.aa12351@q2.ics.uci.edu>
  352. Content-Type: TEXT/PLAIN; charset=US-ASCII
  353. Mime-Version: 1.0
  354. Newsgroups: fa.think-c
  355. X-Message-ID: <Pine.3.89.9403021441.A18096-0100000@dorsai.dorsai.org>
  356. Approved: usenet@q2.ics.uci.edu
  357. Lines: 16
  358. Date: 2 Mar 94 19:25:59 GMT
  359.  
  360. As far as I understand it, the Mac data and resource forks of a file are
  361. essentially two separate files. In the OS, when you open the file, you
  362. can either open the resource fork or the data fork (or both at once, but
  363. then you have to have two separate paths, one for each fork). The reason
  364. most utilities copy only the data fork is because that's the most likely
  365. to be useful on the Unix end; the resource fork wouldn't make any sense,
  366. being in a Mac-specific format. I don't know how it's stored physically
  367. on a disk, whether the resource fork is stored contiguously with the data
  368. fork. Note that there is a third place where file data is stored, the
  369. finder flags and other info about the file - this information is stored
  370. in the catalog.
  371.  
  372. Tommy Brown
  373. tbrown@dorsai.dorsai.org            tommy6@aol.com
  374. "Please continue this petty bickering; I find it most intriguing." - Data
  375.  
  376. 
  377. 
  378. Path: ucivax!gateway
  379. From: omalleyj@umich.edu ("Janelle L. O'Malley")
  380. Subject: list manager
  381. Message-ID: <9403021709.aa26345@q2.ics.uci.edu>
  382. Content-Type: TEXT/plain; charset=US-ASCII
  383. Newsgroups: fa.think-c
  384. X-Message-ID: <Mailstrom.1.04.41954.15089.omalley@d.imap.itd.umich.edu>
  385. Approved: usenet@q2.ics.uci.edu
  386. Lines: 17
  387. Date: 3 Mar 94 01:09:56 GMT
  388.  
  389. I have a question concerning the list manager. I created a list by calling
  390. LNew(...) into which I insert 800 cells using LAddRow(...). I store data into
  391. the cells with LSetCell() with the dataPtr pointing to a string of size 100
  392. characters. The problem is when I scroll the list and the cells outside of the
  393. list display area become visible, they are displayed as junk, in spite of the
  394. string pointed to by dataPtr being valid. I seem to remember the list manager
  395. imposes some kind of limit on the data size, I think 32K (sorry, my IM's are at
  396. work). Am I hitting the limit? If so what is the accepted technique to handle
  397. this?
  398.  
  399. A list of size 800 is a medium size list for this application. When the list is
  400. of size 80 everything is fine. Any ideas?
  401.  
  402. Thanks
  403.  
  404. Kevin
  405.  
  406. 
  407. 
  408. Path: ucivax!gateway
  409. From: chrism@corp.cirrus.com (Chris Metcalfe)
  410. Subject: Re:  Data and Resource Forks
  411. Message-ID: <9403021720.aa27143@q2.ics.uci.edu>
  412. Newsgroups: fa.think-c
  413. X-Message-ID: <9403030120.AA24468@tango.corp.cirrus.com>
  414. Approved: usenet@q2.ics.uci.edu
  415. Lines: 18
  416. Date: 3 Mar 94 01:20:38 GMT
  417.  
  418. There is a parameter block at the beginning of HFS files
  419. that has all sorts of information, including the displacements
  420. into the physical disk file for the resource fork and the
  421. data fork.  This is a very rich area, Mac programmers
  422. are shielded from knowing about it all by the File Manager
  423. routines.  Contained in the parameter block is a File
  424. Attributes 16-bit flag array, in addition to the copious
  425. HFS info.
  426.  
  427. I like MacMiNT.  I recently compared it to Tenon Intersystems'
  428. MachTen.  Their EMACS *requires* virtual memory hardware, and
  429. by asking questions I found out that you have to reboot after
  430. launching MachTen to return to a system without MachTen in
  431. RAM!  All those benefits for $700 (the $500 "Personal" system
  432. doesn't run virtual memory, thus no EMACS)!  What are you using
  433. MacMiNT for (besides free)?
  434.  
  435. -- Chris Metcalfe
  436. 
  437. 
  438. Path: ucivax!gateway
  439. From: walrathw@rferl.org (WalrathW)
  440. Subject: RE: list manager
  441. Message-ID: <9403030122.aa18989@q2.ics.uci.edu>
  442. Content-transfer-encoding: 7BIT
  443. Content-type: TEXT/PLAIN; CHARSET=US-ASCII
  444. Newsgroups: fa.think-c
  445. X-Message-ID: <01H9J5W9TDPU8WXC19@MUVAXA.RFERL.ORG>
  446. Approved: usenet@q2.ics.uci.edu
  447. Lines: 33
  448. Date: 3 Mar 94 09:22:54 GMT
  449.  
  450. >
  451. >
  452. _______________________________________________________________________________
  453. > From: Janelle L. O'Malley on Thu, Mar 3, 1994 5:19
  454. > Subject: list manager
  455. > To: think-c@ics.uci.edu
  456. >
  457. > I have a question concerning the list manager. I created a list by calling
  458. > LNew(...) into which I insert 800 cells using LAddRow(...). I store data into
  459. > the cells with LSetCell() with the dataPtr pointing to a string of size 100
  460. > characters. The problem is when I scroll the list and the cells outside of
  461. > the
  462. > list display area become visible, they are displayed as junk, in spite of the
  463. > string pointed to by dataPtr being valid. I seem to remember the list manager
  464. > imposes some kind of limit on the data size, I think 32K (sorry, my IM's are
  465. > at
  466. > work). Am I hitting the limit? If so what is the accepted technique to handle
  467. > this?
  468. >
  469. > A list of size 800 is a medium size list for this application. When the list
  470. > is
  471. > of size 80 everything is fine. Any ideas?
  472. >
  473. > Thanks
  474. >
  475. > Kevin
  476.  32k is correct. If each entry is 100 bytes long (did I understand you
  477. correctly?) then after 300 or so entries you are probably over your limit. You
  478. can write your own LDEF to get around this, samples abound. There are also some
  479. commercial packages available which don't suffer from these limits. What you
  480. are doing is called "Manger Abuse!"  ;-)
  481.  
  482.   -wayne
  483. 
  484. 
  485. Path: ucivax!gateway
  486. From: skorol@uiuc.edu (Savva Korolev)
  487. Subject: unsubscribe
  488. X-Sender: skorol@ncsa.uiuc.edu (Unverified)
  489. Message-ID: <9403030902.aa22471@q2.ics.uci.edu>
  490. Content-Type: text/plain; charset="us-ascii"
  491. Mime-Version: 1.0
  492. Newsgroups: fa.think-c
  493. X-Message-ID: <9403031702.AA18954@newton.ncsa.uiuc.edu>
  494. Approved: usenet@q2.ics.uci.edu
  495. Lines: 11
  496. Date: 3 Mar 94 17:02:49 GMT
  497.  
  498. unsubscribe
  499.  
  500.  
  501.  
  502. Savva
  503. ___________
  504. ->from office     e-mail: skorol@uiuc.edu
  505.  
  506. THE CHEMVIZ GROUP
  507.  
  508.  
  509. 
  510. 
  511. Path: ucivax!gateway
  512. From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
  513. Subject: How do I get Time Zone and
  514. Message-ID: <9403031010.aa26851@q2.ics.uci.edu>
  515. Posted-Date: 3 Mar 94 10:13:14 U
  516. Newsgroups: fa.think-c
  517. X-Message-ID: <199403031810.AA05834@aerospace.aero.org>
  518. Approved: usenet@q2.ics.uci.edu
  519. Lines: 12
  520. Date: 3 Mar 94 18:10:57 GMT
  521.  
  522. Subject:  How do I get Time Zone and Location from Map?
  523. Does anyone know how to get the time zone and location information from the Map
  524. control panel from within my program?
  525.  
  526. Please reply directly to me and I will summarize to the group if anyone
  527. requests it.
  528.  
  529. -Kirk
  530. crawford@aero.org
  531.  
  532.  
  533.  
  534. 
  535. 
  536. Path: ucivax!gateway
  537. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  538. Subject: Re: How do I get Time Zone and Location from Map?
  539. X-Sender: resnick@tarski.cogsci.uiuc.edu
  540. Message-ID: <9403031247.aa06987@q2.ics.uci.edu>
  541. Content-Type: text/plain; charset="us-ascii"
  542. Mime-Version: 1.0
  543. Newsgroups: fa.think-c
  544. X-Message-ID: <199403032047.AA18323@tarski.cogsci.uiuc.edu>
  545. Approved: usenet@q2.ics.uci.edu
  546. Lines: 89
  547. Date: 3 Mar 94 20:47:58 GMT
  548.  
  549. >Does anyone know how to get the time zone and location information from the Map
  550. >control panel from within my program?
  551.  
  552. Use the ReadLocation() procedure. To set this information, you would use
  553. WriteLocation(). The routines work on parameter RAM where the Map stores
  554. this information. Each procedure takes one parameter, a pointer to a
  555. MachineLocation struct that is as follows:
  556.  
  557. struct MachineLocation {
  558.         Fract latitude;
  559.         Fract longitude;
  560.         union{
  561.                 char dlsDelta;          /* High byte of the field */
  562.                 long gmtDelta;          /* Low three bytes of the field */
  563.         }gmtFlags;
  564. };
  565.  
  566. typedef struct MachineLocation MachineLocation;
  567.  
  568. The latitude and longitude are fractions of a great circle.
  569.  
  570. The gmtDelta field represents the current offset (in seconds) from
  571. Universal (Greenwich Mean) Time to the current time on the Macintosh. So,
  572. if the current Macintosh time is 1:00 AM and current GMT is 2:00AM, then
  573. gmtDelta should be -3600, since the current time is one hour (3600 seconds)
  574. less than GMT. The gmtDelta field is a signed 3-byte value.
  575.  
  576. The high bit (bit 7) of the dlsDelta field represents the current state of
  577. daylight savings time. If daylight savings time is in effect, then bit 7 of
  578. dlsDelta is set; if daylight savings time is not in effect, then bit 7 is
  579. clear. The other 7 bits (bits 0 through 6) of dlsDelta are reserved for
  580. future use by Apple.
  581.  
  582. The value in gmtDelta always represents current offset from GMT, irrelavent
  583. of the setting in dlsDelta; GMT can always be calculated by subtracting
  584. gmtDelta from the current time. That means that during daylight savings
  585. time, the value in gmtDelta will be different from the value during
  586. standard time.
  587.  
  588. Note that gmtFlags is a union of dlsDelta and gmtDelta. That means that you
  589. have to sign extend gmtDelta and preserve the dlsDelta when you set it.
  590.  
  591. long GetGmtDelta(MachineLocation *myLocation)
  592. {
  593.         long returnVal;
  594.  
  595.         returnVal = myLocation->gmtFlags.gmtDelta & 0x00ffffff;
  596.         if((returnVal >> 23) & 1)
  597.                 returnVal |= 0xff000000;
  598.         return returnVal;
  599. }
  600.  
  601. void SetGmtDelta(MachineLocation *myLocation, long myGmtDelta)
  602. {
  603.         char tempDlsDelta;
  604.  
  605.         tempDlsDelta = myLocation->gmtFlags.dlsDelta;
  606.         myLocation->gmtFlags.gmtDelta = myGmtDelta;
  607.         myLocation->gmtFlags.dlsDelta = tempDlsDelta;
  608. }
  609.  
  610. Personally, I prefer to declare my own MachineLocation type so that I don't
  611. have to worry about the sign extending; I let the compiler do it for me:
  612.  
  613. struct MyMachineLocation {
  614.         Fract latitude;
  615.         Fract longitude;
  616.         struct {
  617.                 long dlsDelta : 8;
  618.                 long gmtDelta : 24;
  619.         } gmtFlags;
  620. };
  621.  
  622. typedef struct MyMachineLocation MyMachineLocation;
  623.  
  624. Since they are bitfields, the compiler deals with sign extending and
  625. preserving fields.
  626.  
  627. Good luck.
  628.  
  629. pr
  630.  
  631. --
  632. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  633. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  634. System manager - Cognitive Science Group, Beckman Institute, UIUC
  635. Internet: resnick@cogsci.uiuc.edu
  636.  
  637.  
  638. 
  639. 
  640. Path: ucivax!gateway
  641. From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
  642. Subject: Re: Re- How do I get Time Zo
  643. Message-ID: <9403031318.aa08993@q2.ics.uci.edu>
  644. Posted-Date: 3 Mar 94 13:18:08 U
  645. Newsgroups: fa.think-c
  646. X-Message-ID: <199403032117.AA10376@aerospace.aero.org>
  647. Approved: usenet@q2.ics.uci.edu
  648. Lines: 18
  649. Date: 3 Mar 94 21:18:07 GMT
  650.  
  651. Subject:  RE>Re: How do I get Time Zone
  652.  PR> Use the ReadLocation() procedure. To set this
  653.  PR> information, you would use WriteLocation(). The
  654.  PR> routines work on parameter RAM where the Map stores
  655.  PR> this information. Each procedure takes one parameter,
  656.  PR> a pointer to a MachineLocation struct that is as
  657.  PR> follows:
  658.  
  659. Thanks Pete, I should have looked there.
  660.  
  661. Do you know how to get the actual city name that the Map control panel
  662. displays?
  663. For example, mine says "Los Angeles"?
  664.  
  665. -Kirk
  666. crawford@aero.org
  667.  
  668.  
  669. 
  670. 
  671. Path: ucivax!gateway
  672. From: chrism@corp.cirrus.com (Chris Metcalfe)
  673. Subject: Dean Yu's Windoid Code Crashes
  674. Message-ID: <9403031359.aa11641@q2.ics.uci.edu>
  675. Newsgroups: fa.think-c
  676. X-Message-ID: <9403032159.AA01108@tango.corp.cirrus.com>
  677. Approved: usenet@q2.ics.uci.edu
  678. Lines: 40
  679. Date: 3 Mar 94 21:59:24 GMT
  680.  
  681. Hi --
  682.  
  683. [I posted this in comp.sys.mac.programmers, and I
  684. thought maybe someone in this group might have a
  685. hint.]
  686.  
  687. I finally got a copy of Dean Yu's floating windoid code
  688. as published by "develop" in the September 93 issue, and
  689. the CD.
  690.  
  691. The sample app, "Floaters," is file stamped as follows:
  692.  
  693.         Size:           33k on disk (33,062 bytes used)
  694.         Created:        Fri, Aug 13, 1993, 12:02 PM
  695.         Modified:       Tue, Sep 21, 1993, 9:43 AM
  696.         Version:        1.0d2, c 1993 Apple Computer,
  697.                         Inc., all rights reserved
  698.  
  699.         Suggested size: 256 K
  700.         Current size:   256 K
  701.  
  702. It crashes.  Sigh.
  703.  
  704. It crashes whenever a dialog box is displayed.  Its
  705. own "About Floaters..." dialog from the Apple menu for
  706. example.  The crash occures as soon as the dialog
  707. is dismissed, although the sample palettes have enough
  708. time to redisplay themselves as active before the
  709. sizzling bomb message displays.
  710.  
  711. The crash is:   A System Error Occured
  712.                 unimplemented trap
  713.  
  714. I'm running System 7.0.1 on a PowerBook 100 (16MHz
  715. 68000).
  716.  
  717. What gives?
  718.  
  719. -- Chris Metcalfe
  720.  
  721. 
  722. 
  723. Path: ucivax!gateway
  724. From: idowell@bbn.com
  725. Subject: Data and Resource to one file?
  726. Message-ID: <9403031506.aa16097@q2.ics.uci.edu>
  727. Newsgroups: fa.think-c
  728. X-Message-ID: <9403031506.aa16097@q2.ics.uci.edu>
  729. Approved: usenet@q2.ics.uci.edu
  730. Lines: 8
  731. Date: 3 Mar 94 23:06:39 GMT
  732.  
  733. I'm using a subclass of TCL's CDataFile but I would like
  734. to write a couple of resources to the file as well.
  735. Is this a no-no?  I don't see any obvious way to do it?
  736.  
  737. Any help would be appreciated!
  738.  
  739. Ian Dowell
  740. idowell@bbn.com
  741. 
  742. 
  743. Path: ucivax!gateway
  744. From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
  745. Subject: Re: Re- Re- How do I get Tim
  746. Message-ID: <9403031633.aa22805@q2.ics.uci.edu>
  747. Posted-Date: 3 Mar 94 16:33:10 U
  748. Newsgroups: fa.think-c
  749. X-Message-ID: <199403040033.AA24071@aerospace.aero.org>
  750. Approved: usenet@q2.ics.uci.edu
  751. Lines: 103
  752. Date: 4 Mar 94 00:33:24 GMT
  753.  
  754. Subject:  RE>Re: Re- How do I get Time Z
  755. Well, I answered my own question.  I wanted to get the city name and GMT offset
  756. from the Map control panel.  With Pete Resnick's help and some ResEdit hacking,
  757. I figured out how to get the city name.  Here is the code if anyone is
  758. interested:
  759. /************************************************************************/
  760. /* GetCityAndGMT - This routine will return the name  of the city and   */
  761. /* the GMT offset in seconds that the macintosh is set to. It searches  */
  762. /* the list stored in the MAP control panel.  Requires Sys 7 and Find Folder */
  763. /* requires <folders.h> and <GestaltEqu.h> and <script.h> */
  764. typedef struct MyMachineLocation {
  765.         Fract latitude;
  766.         Fract longitude;
  767.         struct {
  768.                 long dlsDelta : 8;
  769.                 long gmtDelta : 24;
  770.         } gmtFlags;
  771. }MyMachineLocation;
  772. void GetCityAndGMT(unsigned char *City,long *GMTOffset)
  773. {
  774.     Str255                FolderName;
  775.     long                Attrib,
  776.                         DirID;
  777.     short                err,
  778.                         ResRef,
  779.                         HasFindFolder=0,
  780.                         vRefNum;
  781.     unsigned short        NumCitys,
  782.                         *usptr;
  783.     unsigned char         *ucptr,
  784.                         *ucptr2;
  785.     Handle                h;
  786.     MyMachineLocation    loc;
  787.     unsigned long        ByteCount;
  788.     long                *lptr;
  789.  
  790.     /* find out where we are */
  791.     ReadLocation((MachineLocation *)&loc);
  792.  
  793.     /* see if they have Find Folder */
  794.     if(!(err = Gestalt(gestaltFindFolderAttr,&Attrib)))
  795.         HasFindFolder = (Attrib & (1L << gestaltFindFolderPresent));
  796.  
  797.     /* can't find the control panels folder */
  798.     if(!HasFindFolder)
  799.         return;
  800.  
  801.     /* find the folder (gMac is a previously filled SysEnvirons structure) */
  802.     if((err =
  803. FindFolder(gMac.sysVRefNum,kControlPanelFolderType,kOnSystemDisk,&vRefNum,&DirID)))
  804.         return;
  805.  
  806.     /* open the resource file */
  807.     if((ResRef = HOpenResFile(vRefNum,DirID,"\pMap",fsRdPerm)) == -1)
  808.         return;
  809.  
  810.     /* use the res file */
  811.     UseResFile(ResRef);
  812.  
  813.     /* get the list of citys */
  814.     if(!(h = GetResource('CTY#',-4064))){
  815.         CloseResFile(ResRef);
  816.         return;
  817.     }
  818.  
  819.     /* lock the handle */
  820.     HLock(h);
  821.     /* null out the city */
  822.     *City = 0;
  823.     /* find out how many cities there are */
  824.     usptr = (unsigned short *)*h;
  825.     NumCitys = *usptr;
  826.     /* point to the data */
  827.     ucptr = (unsigned char *)*h;
  828.     ucptr += sizeof(unsigned short);
  829.     /* loop for each city */
  830.     while(NumCitys--){
  831.         /* point to the latitude and longitude */
  832.         ucptr2 = ucptr;
  833.         ucptr += 18;                    /* skip ahead to the city name */
  834.         ucptr2 += 2;                    /* skip a word */
  835.         lptr = (long *)ucptr2;            /* lat and long are longs */
  836.         if(loc.latitude == *lptr++){    /* is the city the same lat as ours? */
  837.             if(loc.longitude == *lptr){    /* is it the same longitude?  */
  838.                 ByteCount = *ucptr + 1;        /* it is, copy the name */
  839.                 BlockMove(ucptr,City,ByteCount);
  840.                 break;                        /* and get out of here */
  841.             }
  842.         }
  843.         /* skip past the end of the string */
  844.         if(*ucptr & 0x01)    /* it is odd */
  845.             ucptr += *ucptr + 1;
  846.         else
  847.             ucptr += *ucptr + 2;
  848.     }
  849.     HUnlock(h);                            /* don't forget to unlock those handles */
  850.     ReleaseResource(h);                    /* and release the resource */
  851.     CloseResFile(ResRef);                /* and close the res file */
  852.     *GMTOffset = loc.gmtFlags.gmtDelta;    /* store the GMT delta */
  853. }
  854.  
  855.  
  856.  
  857. 
  858. 
  859. Path: ucivax!gateway
  860. From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
  861. Subject: matrix functions
  862. Message-ID: <9403031953.aa02904@q2.ics.uci.edu>
  863. X-Mailer: ELM [version 2.3 PL2]
  864. Newsgroups: fa.think-c
  865. X-Message-ID: <9403040353.AA28773@mozart.aero.ufl.edu>
  866. Approved: usenet@q2.ics.uci.edu
  867. Lines: 3
  868. Date: 4 Mar 94 03:53:42 GMT
  869.  
  870.     Does anyone know where in the net I can find matrix manipulation
  871. code in C?  I need specifically a function that can a system of equation
  872. whose left-hand side is a banded matrix.  Suggestions?
  873. 
  874. 
  875. Path: ucivax!gateway
  876. From: blumenau@campanile.eecs.berkeley.edu ("Trevor I. Blumenau")
  877. Subject: QuickTime import
  878. Message-ID: <9403040145.aa17634@q2.ics.uci.edu>
  879. Newsgroups: fa.think-c
  880. X-Message-ID: <199403040944.BAA00641@campanile.eecs.berkeley.edu>
  881. Approved: usenet@q2.ics.uci.edu
  882. Lines: 13
  883. Date: 4 Mar 94 09:45:05 GMT
  884.  
  885. I know QuickTime can import certain file formats automatically.  For
  886. example, if you open a _sound_ file using GetFilePreview, you're
  887. automatically prompted with a "convert" dialog box.  I think the same
  888. is true for an _AIFF_ file.
  889.  
  890. Does anyone have a comprehensive list of the formats that are recognized
  891. and automatically converted?  (If possible, I'd like a list for QT 1.6
  892. as well as QT 2.0.)
  893.  
  894. Your help is much appreciated.
  895.  
  896. Trevor
  897. blumenau@eecs.berkeley.edu
  898. 
  899. 
  900. Path: ucivax!gateway
  901. From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
  902. Subject: Re: matrix functions
  903. Message-ID: <9403040558.aa10991@q2.ics.uci.edu>
  904. Newsgroups: fa.think-c
  905. X-Message-ID: <9403041356.AA13702@NADC.NADC.NAVY.MIL>
  906. Approved: usenet@q2.ics.uci.edu
  907. Lines: 4
  908. Date: 4 Mar 94 13:58:20 GMT
  909.  
  910.  
  911. Try Numerical Recipes in C.  Also, there is netlib.  Send a message to
  912. netlib@ornl.gov with the line send help (I think) or send list (I think).
  913. Barry Kirsch
  914. 
  915. 
  916. Path: ucivax!gateway
  917. From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
  918. Subject: Re(2): Re- Re- How do I get Tim
  919. Message-ID: <9403040603.aa11384@q2.ics.uci.edu>
  920. Newsgroups: fa.think-c
  921. X-Message-ID: <9403040603.aa11384@q2.ics.uci.edu>
  922. Approved: usenet@q2.ics.uci.edu
  923. Lines: 17
  924. Date: 4 Mar 94 14:03:57 GMT
  925.  
  926. Thanks for sending the code, Kirk. With System 7.1 (and later?), there's a
  927. date and time control panel. I wonder if the Map functionality will be
  928. integrated into this control panel in the future.
  929.  
  930. Mike.
  931.  
  932.  ------ From: Kirk Crawford, Thu, Mar 3, 1994 ------
  933.  
  934. Subject:  RE>Re: Re- How do I get Time Z
  935. Well, I answered my own question.  I wanted to get the city name and GMT
  936. offset
  937. from the Map control panel.  With Pete Resnick's help and some ResEdit
  938. hacking,
  939. I figured out how to get the city name.  Here is the code if anyone is
  940. interested:
  941.  
  942.  
  943. 
  944. 
  945. Path: ucivax!gateway
  946. From: boudinot@bobby.iaf.cnrs-gif.fr
  947. Subject: MacTCP programming
  948. X-Sender: boudinot@bobby.iaf.cnrs-gif.fr (Unverified)
  949. Message-ID: <9403040649.aa13201@q2.ics.uci.edu>
  950. Newsgroups: fa.think-c
  951. X400-Received: by /PRMD=cicb/ADMD=atlas/C=FR/;
  952.  Relayed; 04 Mar 94 15:48:50+0100
  953. X400-Received: by /PRMD=cnrs-gif/ADMD=0/C=fr/;
  954.  Relayed; 04 Mar 94 15:48:41+0100
  955. X-Message-ID: <762792521.18382.0-hermes.cnrs-gif.fr*@MHS>
  956. Approved: usenet@q2.ics.uci.edu
  957. Lines: 15
  958. Date: 4 Mar 94 14:49:02 GMT
  959.  
  960. As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
  961. from MPW to Think C 6.0.1. The compilation is OK, but at run time the
  962. function OpenResolver fails with a return code of -1.
  963. Does anyone have any suggestions?, Where can I get MacTCP functions
  964. descriptions.
  965. Thanks,
  966. ----------------------------------------------------------------------
  967. Michel Boudinot                         CNRS. Institut Alfred Fessard,
  968. Phone:  (33-1) 69 82 34 02              Avenue de la Terrasse,
  969. Fax:    (33-1) 69 07 05 38              Gif sur Yvette, 91198 Cedex
  970. E-mail: boudinot@bobby.iaf.cnrs-gif.fr  France.
  971. ----------------------------------------------------------------------
  972.  
  973.  
  974.  
  975. 
  976. 
  977. Path: ucivax!gateway
  978. From: brians@fluxes.plk.af.mil ("Brian J. Scamman (WSAI")
  979. Subject: Mac Driver for IBM 3633 Optical Drive
  980. Message-ID: <9403040802.aa16228@q2.ics.uci.edu>
  981. Newsgroups: fa.think-c
  982. X-Message-ID: <9403041601.AA09579@fluxes.plk.af.mil.plk.af.mil>
  983. Approved: usenet@q2.ics.uci.edu
  984. Lines: 11
  985. Date: 4 Mar 94 16:02:26 GMT
  986.  
  987.  
  988. I tried to post this to "News" but it never showed up.  Perhaps this group can
  989. help.
  990.  
  991.  
  992. I'm looking for any Macintosh drivers for an IBM 3633 Optical Drive.
  993. Technical Specs (including wiring and low-level signals) would be very
  994. helpful.
  995.  
  996. Please send responses to: brians@fluxes.plk.af.mil
  997. Thanks
  998. 
  999. 
  1000. Path: ucivax!gateway
  1001. From: nagel@barracuda.rdatasys.com ("Mark D. Nagel")
  1002. Subject: ADMIN: send administrative requests to think-c-request
  1003. Message-ID: <9403041008.aa24241@q2.ics.uci.edu>
  1004. Newsgroups: fa.think-c
  1005. X-Message-ID: <28397.762804136@barracuda>
  1006. Reply-To: nagel@rdatasys.rdatasys.com
  1007. Approved: usenet@q2.ics.uci.edu
  1008. Organization: Relational Data Systems, Irvine, CA
  1009. Lines: 8
  1010. Date: 4 Mar 94 18:08:36 GMT
  1011. Phone: (714) 263-3899
  1012.  
  1013. It seems some people have forgotten again that administrative
  1014. requests, such as unsubscribe messages, should be sent to
  1015. think-c-request@ics.uci.edu.  Sending them to think-c will only
  1016. dribble useless information into hundreds of mailboxes.  Please send
  1017. them to the one mailbox that will actually accomplish something.
  1018.  
  1019. Thanks,
  1020. Mark
  1021. 
  1022. 
  1023. Path: ucivax!gateway
  1024. From: askwersk@mit.edu
  1025. Subject: Re: matrix functions
  1026. Message-ID: <9403041656.aa14897@q2.ics.uci.edu>
  1027. In-Reply-To: Your message of 04 Mar 94 13:58:20 +0000.
  1028.              <9403040558.aa10991@q2.ics.uci.edu>
  1029. Newsgroups: fa.think-c
  1030. X-Message-ID: <9403041938.AA26929@bolognese.MIT.EDU>
  1031. Approved: usenet@q2.ics.uci.edu
  1032. Lines: 12
  1033. Date: 5 Mar 94 00:56:51 GMT
  1034.  
  1035.  
  1036.  
  1037. I wrote some of my own matrix manipulation functions. They were derived
  1038. from Numerical recipes in C, but remember that Numerical recipes in
  1039. C uses "malloc" to allocate space for vectors and matrixes. Its a simple
  1040. matter to convert all the malloc's to NewPtr's though. If you plan on using
  1041. their integrator functions (runge kutta, etc), you might want change all
  1042. the "floats" into "double". I had problem when I tried to use those functions
  1043. but when I changed all the floats into doubles, it worked fine.
  1044.  
  1045.  
  1046. Adam
  1047. 
  1048. 
  1049. Path: ucivax!gateway
  1050. From: chharris@u.washington.edu (The Only Cow)
  1051. Subject: Offscreen Graphics
  1052. X-Sender: chharris@stein3.u.washington.edu
  1053. Message-ID: <9403042021.aa29037@q2.ics.uci.edu>
  1054. Content-Type: TEXT/PLAIN; charset=US-ASCII
  1055. Mime-Version: 1.0
  1056. Newsgroups: fa.think-c
  1057. X-Message-ID: <Pine.3.89.9403042029.A3767-0100000@stein3.u.washington.edu>
  1058. Approved: usenet@q2.ics.uci.edu
  1059. Lines: 24
  1060. Date: 5 Mar 94 04:21:19 GMT
  1061.  
  1062. Hello Folks,
  1063.       I'm trying to write a little game here that allows you to move a
  1064. ship around the screen in responce to various key presses.  The movement
  1065. basically works okay, but there is lots o' flicker, because it uses
  1066. DrawPicture() every time it updates....
  1067.       From what I've heard, I should draw the picture somehow off screen
  1068. and then copy it back to whatever window with CopyBits().
  1069.       I looked through Think Reference and there seems to be a few
  1070. different ways to impliment offscreen graphics, but I can't seem to
  1071. figure out which one to use.  I tried copying the source code from one of
  1072. the examples, but I wasn't able to get it to work.
  1073.       If anybody has any good commented code for creating offscreen
  1074. graphics, please let me know.
  1075.  
  1076. Thanks.
  1077.  
  1078. -Chris
  1079.  
  1080. ------------------------------------------------------------------------------
  1081.    "To error is human, but to really foul things up, you need a computer."
  1082.                    Send questions, comments, flames, etc. to:
  1083.                  Chris Harris / chharris@stein.u.washington.edu
  1084.                       PGP Signature availible via finger...
  1085.  
  1086. 
  1087. 
  1088. Path: ucivax!gateway
  1089. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  1090. Subject: Re: MacTCP programming
  1091. X-Sender: resnick@tarski.cogsci.uiuc.edu
  1092. Message-ID: <9403042112.aa01247@q2.ics.uci.edu>
  1093. Content-Type: text/plain; charset="us-ascii"
  1094. Mime-Version: 1.0
  1095. Newsgroups: fa.think-c
  1096. X-Message-ID: <199403050511.AA20022@tarski.cogsci.uiuc.edu>
  1097. Approved: usenet@q2.ics.uci.edu
  1098. Lines: 25
  1099. Date: 5 Mar 94 05:12:03 GMT
  1100.  
  1101. At  2:49 PM 3/4/94 +0000, boudinot@bobby.iaf.cnrs-gif.fr wrote:
  1102. >As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
  1103. >from MPW to Think C 6.0.1. The compilation is OK, but at run time the
  1104. >function OpenResolver fails with a return code of -1.
  1105.  
  1106. Make sure that you have either prototypes turned on, or that you make all
  1107. of the #define's for the numeric constants longs by putting an "L" after
  1108. each number. The DNR header files are fraught with difficulty in THINK C.
  1109. There is a compilation of diffs between the files somewhere.
  1110.  
  1111. >Does anyone have any suggestions?, Where can I get MacTCP functions
  1112. >descriptions.
  1113.  
  1114. Take a look by anonymous FTP at seeding.apple.com. There is a directory
  1115. that contains the Programmers manual and the header files.
  1116.  
  1117. pr
  1118.  
  1119. --
  1120. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1121. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1122. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1123. Internet: resnick@cogsci.uiuc.edu
  1124.  
  1125.  
  1126. 
  1127. 
  1128. Path: ucivax!gateway
  1129. From: rmah@panix.com ("Robert S. Mah")
  1130. Subject: Re: MacTCP programming
  1131. Message-ID: <9403050012.aa08002@q2.ics.uci.edu>
  1132. Content-Type: text/plain; charset="us-ascii"
  1133. Mime-Version: 1.0
  1134. Newsgroups: fa.think-c
  1135. X-Message-ID: <199403050811.AA09146@panix.com>
  1136. Approved: usenet@q2.ics.uci.edu
  1137. Lines: 21
  1138. Date: 5 Mar 94 08:12:15 GMT
  1139.  
  1140. At  2:49 PM 3/4/94 +0000, boudinot@bobby.iaf.cnrs-gif.fr wrote:
  1141. >As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
  1142. >from MPW to Think C 6.0.1. The compilation is OK, but at run time the
  1143. >function OpenResolver fails with a return code of -1.
  1144. >Does anyone have any suggestions?, Where can I get MacTCP functions
  1145. >descriptions.
  1146.  
  1147. If I recall correctly, there's a bug in the early MacTCP headers.
  1148. Something to do with using "int" instead of "long" or something like that.
  1149. It is covered in a Tech Note and was fixed in the latest MacTCP headers
  1150. (available at seeding.apple.com).
  1151.  
  1152. Hope this helps.
  1153.  
  1154. Cheers,
  1155. Rob
  1156.  
  1157. ____________________________________________________________________________
  1158.  Robert S. Mah                  One Step Beyond              rmah@panix.com
  1159.  
  1160.  
  1161. 
  1162. 
  1163. Path: ucivax!gateway
  1164. From: bhamlin@well.sf.ca.us ("Brian M. Hamlin")
  1165. Subject: Re: Re- Re- How do I get Tim
  1166. Message-ID: <9403050944.aa13503@q2.ics.uci.edu>
  1167. Newsgroups: fa.think-c
  1168. X-Message-ID: <199403051739.JAA00748@well.sf.ca.us>
  1169. Approved: usenet@q2.ics.uci.edu
  1170. Lines: 3
  1171. Date: 5 Mar 94 17:44:02 GMT
  1172.  
  1173.  
  1174.   One thing you might want to know is that FindFolder() works under
  1175. System 6, if thats what you are worried about....
  1176. 
  1177. 
  1178. Path: ucivax!gateway
  1179. From: bin@primate.wisc.edu (Brain in Neutral)
  1180. Subject: converting FSOpen() file pointer to stdio pointer?
  1181. Message-ID: <9403061633.aa22877@q2.ics.uci.edu>
  1182. X-Mailer: ELM [version 2.4 PL21]
  1183. Content-Type: text
  1184. Content-Length: 310
  1185. Newsgroups: fa.think-c
  1186. X-Message-ID: <9403070033.AA26303@saimiri.primate.wisc.edu>
  1187. Approved: usenet@q2.ics.uci.edu
  1188. Lines: 10
  1189. Date: 7 Mar 94 00:33:14 GMT
  1190.  
  1191. Is there a way in THINK C (6) to convert a file reference number
  1192. such as that returned by FSOpen() or FSpOpenDF() and convert it
  1193. to a FILE * pointer such as that returned by fopen()?  I want
  1194. to open a data file using Macintosh OS calls but read the thing
  1195. using stdio.
  1196.  
  1197. Paul DuBois
  1198. dubois@primate.wisc.edu
  1199.  
  1200. --
  1201. 
  1202. 
  1203. Path: ucivax!gateway
  1204. From: jaha@secrc.abb.se ("Jan R. M. Rohman")
  1205. Subject: ???
  1206. Message-ID: <9403070742.aa10040@q2.ics.uci.edu>
  1207. Newsgroups: fa.think-c
  1208. X-Message-ID: <9403071537.AA03063@kbmhp1.secrc.abb.se>
  1209. Reply-To: jaha@secrc.abb.se
  1210. Approved: usenet@q2.ics.uci.edu
  1211. Lines: 11
  1212. Date: 7 Mar 94 15:42:45 GMT
  1213.  
  1214.  
  1215. How do I know if a user only use black & white on a color monitor?
  1216.  
  1217. ----------------------------------------------------------------------
  1218.  From:    jaha@secrc.abb.se  Jan R. M. Rohman                          !
  1219.  Phone:    +46 21 32 31 48       ABB Corporate Research Center Dept. KF    !
  1220.  Fax:    +46 21 32 31 01       Department of Computational Methods,      !
  1221.                            Electromagnetic Fields and Fluid Dynamics !
  1222.                            S-721 78 Vasteras, SWEDEN                 !
  1223.  Home:   Vasagatan 35, 722 15 Vasteras, Phone:  +46 21 83 06 00      !
  1224. ----------------------------------------------------------------------
  1225. 
  1226. 
  1227. Path: ucivax!gateway
  1228. From: KFISCHER@arac.llnl.gov (Kathleen Fischer)
  1229. Subject: memcpy question (probably a stupid one!)
  1230. Message-ID: <9403070808.aa11492@q2.ics.uci.edu>
  1231. Newsgroups: fa.think-c
  1232. X-Message-ID: <01H9OME2J1OG000PIS@addvax.llnl.gov>
  1233. Approved: usenet@q2.ics.uci.edu
  1234. X-VMS-To: addvax::in%"think-c@ics.uci.edu"
  1235. Lines: 14
  1236. Date: 7 Mar 94 16:08:33 GMT
  1237. X-Envelope-to: think-c@ics.uci.EDU
  1238.  
  1239. Ok ... I have JUST started programming using Symantic C++ and I began by using
  1240. a small program from my C++ class (I'm very new to C++, but know C).  This
  1241. program uses memcpy() ...  a familiar old C routine.
  1242.  
  1243. However, the linker yells at me saying that the routine doesn't exit even though
  1244. I have found it (in mem.c) and it is included in ANSI++ lib which I have
  1245. included in my project.  On top of that, I did a search and discovered that
  1246. fwrite() (I think that was the routine) also calls memcpy(), so I made a test
  1247. call to fwrite, commenting out my memcpy() and the linker was happy.  I have
  1248. checked my input args to memcpy and they are fine...so what
  1249. gives?
  1250.  
  1251. Help!
  1252. Kathleen
  1253. 
  1254. 
  1255. Path: ucivax!gateway
  1256. From: Jean-Marie.Laborde@imag.fr (Jean-Marie Laborde)
  1257. Subject: Re: B&W or not
  1258. X-Sender: laborde@isis.imag.fr
  1259. Message-ID: <9403071057.aa23548@q2.ics.uci.edu>
  1260. Content-Type: text/plain; charset="us-ascii"
  1261. Mime-Version: 1.0
  1262. Newsgroups: fa.think-c
  1263. X-Message-ID: <199403071857.AA17303@isis.imag.fr>
  1264. Approved: usenet@q2.ics.uci.edu
  1265. Lines: 31
  1266. Date: 7 Mar 94 18:57:22 GMT
  1267.  
  1268. A possible way is to ask if the red (rouge) color is available
  1269.  
  1270. {
  1271. Boolean MDevBandW;
  1272. RGBColor        rougeStd;
  1273. rougeStd.red    =0xDD6B;
  1274. rougeStd.green  =0x08C2;
  1275. rougeStd.blue   =0x06A2;
  1276. MDevGray=!RealColor(&rougeStd);
  1277.  
  1278. .....
  1279.  
  1280. }
  1281.  
  1282. I would have another question.
  1283. How to know if the user has a Real Gray-scale Monitor or is not only
  1284. working on a Color Monitor switched to Gray or B&W?
  1285. Indeed the rendering of colors is much more crispy
  1286. on a real gray-scale than with approximated grays on a Color Monitor when
  1287. colors are turned off!
  1288.  
  1289.  
  1290. ****************************************************************************
  1291. Jean-Marie Laborde                                   jean-marie.laborde@imag.fr
  1292. Responsable du Projet IMAG Cabri-geometre
  1293. Laboratoire de Structures Discretes et de Didactique - IMAG
  1294. Universite Joseph Fourier - CNRS          BP 53 38041 Grenoble cedex 9 FRANCE
  1295. (33) 76 51 46 10   (sec 76 51 46 16)      (fax 76 51 45 55)
  1296. ****************************************************************************
  1297.  
  1298.  
  1299. 
  1300. 
  1301. Path: ucivax!gateway
  1302. From: ribtm@ttacs1.ttu.edu (Greg Vaughn)
  1303. Subject: TransSkel users?
  1304. Message-ID: <9403071100.aa23868@q2.ics.uci.edu>
  1305. Content-transfer-encoding: 7BIT
  1306. Content-type: text/plain; charset="us-ascii"
  1307. MIME-version: 1.0
  1308. Newsgroups: fa.think-c
  1309. X-Message-ID: <01H9OWLJEBUQ9D4O7T@ttacs.ttu.edu>
  1310. Approved: usenet@q2.ics.uci.edu
  1311. Lines: 22
  1312. Date: 7 Mar 94 19:00:54 GMT
  1313.  
  1314. I'm hoping someone on this list has experience using the TransSkel 3.10
  1315. application skeleton maintained by Paul DuBois with Think C 6.0.1 and is
  1316. willing to help me out. I'm also hoping to avoid bothering Paul directly
  1317. since he has already put a lot of time and effort into TS.
  1318.  
  1319. I want to put dialog controls in part of a window that I also draw in. I'm
  1320. hoping that I can do it in TS, but I'm not sure. I'm new to Mac programming
  1321. and only have the SpInside Mac Hypercard stacks available, so I was hoping
  1322. to use TS to make my job easier.
  1323.  
  1324. If anyone is familiar with doing this in TS (fat chance I know, but I
  1325. thought I'd try) please e-mail me so I can talk it over with you.
  1326.  
  1327. Thanks
  1328.  
  1329.    ______
  1330.   /\__  _\                  | Greg Vaughn
  1331.   \/_/\ \/  exas            | Grad Student, Dept. of Physics
  1332.      \ \_\  ech University  | Insulator Research Laboratory
  1333.       \/_/  Lubbock, Texas  | E-Mail: ribtm@ttacs.ttu.edu
  1334.  
  1335.  
  1336. 
  1337. 
  1338. Path: ucivax!gateway
  1339. From: bin@primate.wisc.edu (Brain in Neutral)
  1340. Subject: Re: TransSkel users?
  1341. Message-ID: <9403080820.aa11944@q2.ics.uci.edu>
  1342. In-Reply-To: <9403071100.aa23868@q2.ics.uci.edu> from "Greg Vaughn" at Mar 7, 94 07:00:54 pm
  1343. X-Mailer: ELM [version 2.4 PL21]
  1344. Content-Type: text
  1345. Content-Length: 1087
  1346. Newsgroups: fa.think-c
  1347. X-Message-ID: <9403081619.AA18700@saimiri.primate.wisc.edu>
  1348. Approved: usenet@q2.ics.uci.edu
  1349. Lines: 23
  1350. Date: 8 Mar 94 16:20:15 GMT
  1351.  
  1352. >I'm hoping someone on this list has experience using the TransSkel 3.10
  1353. >application skeleton maintained by Paul DuBois with Think C 6.0.1 and is
  1354. >willing to help me out. I'm also hoping to avoid bothering Paul directly
  1355. >since he has already put a lot of time and effort into TS.
  1356.  
  1357. Actually, I'm happy to get questions, since although people grab TransSkel
  1358. from my ftp machine every day, it's very rare that I get any kind of feedback
  1359. on it.  I figure most people take a brief look and drag it to the trash.
  1360.  
  1361. >I want to put dialog controls in part of a window that I also draw in. I'm
  1362. >hoping that I can do it in TS, but I'm not sure. I'm new to Mac programming
  1363. >and only have the SpInside Mac Hypercard stacks available, so I was hoping
  1364. >to use TS to make my job easier.
  1365.  
  1366. It's not clear to me what you're trying to do.  Is the window a dialog
  1367. window?  If so, there are a lot of TransSkel calls for this kind of thing.
  1368. If it's not a dialog window, I'm not sure what you mean by "dialog controls",
  1369. unless you just mean controls.  Please clarify.
  1370.  
  1371. Paul DuBois
  1372. dubois@primate.wisc.edu
  1373.  
  1374. --
  1375. 
  1376. 
  1377. Path: ucivax!gateway
  1378. From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
  1379. Subject: Desperately need help with GetClip()
  1380. Message-ID: <9403080902.aa14736@q2.ics.uci.edu>
  1381. Newsgroups: fa.think-c
  1382. X-Message-ID: <2liaqk$2hp@nagos.lif.icnet.uk>
  1383. Approved: usenet@q2.ics.uci.edu
  1384. Organization: Imperial Cancer Research Fund
  1385. Lines: 19
  1386. Date: 8 Mar 94 17:02:39 GMT
  1387.  
  1388.  
  1389. To whoever could give me some help with GetClip()
  1390.  
  1391. I am having a problem with using the Handle data type in Think C++
  1392. (Symantec).
  1393.  
  1394. I have the declaration:
  1395.  
  1396. RgnHandle oldClip;
  1397.  
  1398. and later on I try to do :
  1399.  
  1400. GetClip(oldClip);
  1401.  
  1402. The code compile ok. but on running the system simply freezes.
  1403.  
  1404. Would anyone kindly give me  some help with this problem.
  1405.  
  1406. Josh.
  1407. 
  1408. 
  1409. Path: ucivax!gateway
  1410. From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
  1411. Subject: RE>Desperately need help with GetClip()
  1412. Message-ID: <9403081235.aa29142@q2.ics.uci.edu>
  1413. X-Mailer: InterCon Dispatcher/SMTP for QuickMail
  1414. Newsgroups: fa.think-c
  1415. X-Message-ID: <199403081435434999@macsrv.mgi.com>
  1416. Approved: usenet@q2.ics.uci.edu
  1417. X-Priority: 4
  1418. Lines: 55
  1419. Date: 8 Mar 94 20:35:12 GMT
  1420.  
  1421. Date    3/8/94
  1422. Subject    RE>Desperately need help wi
  1423. From    Brian Bezanson
  1424. To    think-c
  1425.  
  1426.         Reply to:   RE>Desperately need help with GetClip()
  1427. >To whoever could give me some help with GetClip()
  1428. >
  1429. >I am having a problem with using the Handle data type in Think C++
  1430. >(Symantec).
  1431. >
  1432. >I have the declaration:
  1433. >
  1434. >RgnHandle oldClip;
  1435. >
  1436. >and later on I try to do :
  1437. >
  1438. >GetClip(oldClip);
  1439. >
  1440. >The code compile ok. but on running the system simply freezes.
  1441. >
  1442. >Would anyone kindly give me  some help with this problem.
  1443. >
  1444. >Josh.
  1445. >
  1446.  
  1447. You need to add in between the line
  1448.  
  1449. oldClip = NewRgn();
  1450.  
  1451. You need to allocate a Region before calling commands that use a destination
  1452. region.
  1453.  
  1454. Here's a code sample from THINK Reference (buy it if you don't have it).
  1455.  
  1456. /* CODE EXAMPLE #1 */
  1457. saveClipRgn = NewRgn();            /* get an empty region */
  1458. GetClip( saveClipRgn );            /* save current */
  1459. SetClip( myClipRgn );            /* install desired clipRgn */
  1460.  
  1461. /*... ( draw a figure )  ... */
  1462.  
  1463. SetClip( saveClipRgn );            /* restore previous value */
  1464. DisposeRgn( saveClipRgn );        /* not needed any more */
  1465.  
  1466. ====
  1467. Brian R Bezanson                      Phone: +1 612 854 1220
  1468. Management Graphics, Inc.             Fax:   +1 612 851 6159
  1469. 1401 E 79th Street                    internet: bezanson@mgi.com
  1470. Minneapolis, MN 55425                 AppleLink: BEZANSON
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476. 
  1477. 
  1478. Path: ucivax!gateway
  1479. From: rmah@panix.com ("Robert S. Mah")
  1480. Subject: Re: Desperately need help with GetClip()
  1481. Message-ID: <9403081236.aa29393@q2.ics.uci.edu>
  1482. Content-Type: text/plain; charset="us-ascii"
  1483. Mime-Version: 1.0
  1484. Newsgroups: fa.think-c
  1485. X-Message-ID: <199403082036.AA16955@panix.com>
  1486. Approved: usenet@q2.ics.uci.edu
  1487. Lines: 33
  1488. Date: 8 Mar 94 20:36:31 GMT
  1489.  
  1490. At  5:02 PM 3/8/94 +0000, Joshua Kafeero wrote:
  1491. >
  1492. >I have the declaration:
  1493. >
  1494. >RgnHandle oldClip;
  1495. >
  1496. >and later on I try to do :
  1497. >
  1498. >GetClip(oldClip);
  1499. >
  1500. >The code compile ok. but on running the system simply freezes.
  1501.  
  1502. GetClip() simply copies the current clipping region into the region you
  1503. pass to it.  Thus, the region you pass to it, "oldClip" must have already
  1504. been created.
  1505.  
  1506. So, do something like the following...
  1507.  
  1508. RgnHandle oldClip;
  1509.  
  1510. oldClip = NewRgn();     // you should check for NULL here
  1511. GetClip( oldClip );
  1512. ...
  1513. SetClip( oldClip );
  1514. DisposeRgn( oldClip );
  1515.  
  1516. Cheers,
  1517. Rob
  1518.  
  1519. ____________________________________________________________________________
  1520.  Robert S. Mah                  One Step Beyond              rmah@panix.com
  1521.  
  1522.  
  1523. 
  1524. 
  1525. Path: ucivax!gateway
  1526. From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
  1527. Subject: Re: Desperately need help with GetClip()
  1528. Message-ID: <9403081312.aa01585@q2.ics.uci.edu>
  1529. Newsgroups: fa.think-c
  1530. X-Message-ID: <9403081312.aa01585@q2.ics.uci.edu>
  1531. Approved: usenet@q2.ics.uci.edu
  1532. Lines: 33
  1533. Date: 8 Mar 94 21:12:45 GMT
  1534.  
  1535. I think you have to allocate the region first. Try:
  1536.  
  1537. RgnHandle    oldClip;
  1538.  
  1539. oldCip = NewRgn();
  1540. GetClip(oldClip);
  1541.  
  1542. ...
  1543. SetClip(oldClip);
  1544. DisposeRgn(oldClip); // I think you need to do this...
  1545.  
  1546.  ------ From: Joshua Kafeero, Tue, Mar 8, 1994 ------
  1547.  
  1548. To whoever could give me some help with GetClip()
  1549.  
  1550. I am having a problem with using the Handle data type in Think C++
  1551. (Symantec).
  1552.  
  1553. I have the declaration:
  1554.  
  1555. RgnHandle oldClip;
  1556.  
  1557. and later on I try to do :
  1558.  
  1559. GetClip(oldClip);
  1560.  
  1561. The code compile ok. but on running the system simply freezes.
  1562.  
  1563. Would anyone kindly give me  some help with this problem.
  1564.  
  1565. Josh.
  1566.  
  1567.  
  1568. 
  1569. 
  1570. Path: ucivax!gateway
  1571. From: gurgle@netcom.com (Pete Gontier)
  1572. Subject: Re: Desperately need help with GetClip()
  1573. Message-ID: <9403081433.ab07832@q2.ics.uci.edu>
  1574. In-Reply-To: <9403080902.aa14736@q2.ics.uci.edu> from "Joshua Kafeero" at Mar 8, 94 05:02:39 pm
  1575. X-Mailer: ELM [version 2.4 PL23]
  1576. Content-Transfer-Encoding: 7bit
  1577. Content-Type: text/plain; charset=US-ASCII
  1578. Content-Length: 428
  1579. MIME-Version: 1.0
  1580. Newsgroups: fa.think-c
  1581. X-Message-ID: <199403082233.OAA21082@netcom9.netcom.com>
  1582. Approved: usenet@q2.ics.uci.edu
  1583. Lines: 15
  1584. Date: 8 Mar 94 22:33:15 GMT
  1585.  
  1586. > RgnHandle oldClip;
  1587. > GetClip(oldClip);
  1588. >
  1589. > The code compile ok. but on running the system simply freezes.
  1590.  
  1591. The problem is not with handles or region handles. You need to do this:
  1592.  
  1593.     RgnHandle oldClip = NewRgn ( );
  1594.     GetClip (oldClip);
  1595.  
  1596. The error-checking for this code is missing; you should check to see if
  1597. NewRgn returned 0 and do something appropriate if so.
  1598.  
  1599. --
  1600.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  1601. 
  1602. 
  1603. Path: ucivax!gateway
  1604. From: dnebing@andy.bgsu.edu (Dave Nebinger)
  1605. Subject: SCGetUserNameRec vs Parameter Error (fight to the death)
  1606. Message-ID: <9403082009.aa26513@q2.ics.uci.edu>
  1607. Content-type: text/plain; charset="us-ascii"
  1608. Mime-Version: 1.0
  1609. Newsgroups: fa.think-c
  1610. X-Message-ID: <01H9QW62OFZ40037GZ@opie.bgsu.edu>
  1611. Approved: usenet@q2.ics.uci.edu
  1612. Lines: 80
  1613. Date: 9 Mar 94 04:09:59 GMT
  1614. X-Envelope-to: think-c@ics.uci.EDU
  1615.  
  1616.  
  1617.   In the following code which I have attached below, I am having a problem
  1618. using the SCGetUserNameRec call.  When I make the SyncServerDispatch call,
  1619. I always get an OSErr value of -50 (parameter error).
  1620.  
  1621.   I am running a IIci running system 7.1 with local file sharing running and
  1622. one person logged into the mac.  The code follows.  Anyone using the
  1623. AppleShare lib who can figure out where the problem is will be awarded a
  1624. bottle of YooHoo.  ;-)
  1625.  
  1626.   Thanks in advance,
  1627.  
  1628.   Dave Nebinger.
  1629.  
  1630. /*
  1631.     GetUsersTest.c
  1632.  
  1633.     Prints out the names of all the connected users.
  1634.  
  1635.     03/08/94 dn - Created.
  1636. */
  1637.  
  1638. #include <stdio.h>
  1639. #include <console.h>
  1640.  
  1641. #include <LibTraps.h>
  1642. #include <LibInit.h>
  1643.  
  1644. #include "ServerControlIntf.h"
  1645.  
  1646. /* Prototypes */
  1647. void main(void);
  1648. void GetUsers(void);
  1649.  
  1650. void main(){
  1651.     int argc;
  1652.     char** argv;
  1653.  
  1654.     argc=ccommand(&argv);
  1655.  
  1656.     if (TrapAvailable(ServerDispatch)){
  1657.         GetUsers();
  1658.     }
  1659. }
  1660.  
  1661. void GetUsers(){
  1662.     OSErr err;
  1663.     Str31 userName;
  1664.     long Position;
  1665.     SCParamBlockRec scPB;
  1666.  
  1667.     printf("\n\nListing all connected users...\n\n");
  1668.     Position=0L;
  1669.     err=noErr;
  1670.  
  1671.     do {
  1672.         scPB.userInfoPB.scCode=SCGetUserNameRec;
  1673.         scPB.userInfoPB.scNamePtr=userName;
  1674.         scPB.userInfoPB.scPosition=Position;
  1675.  
  1676.         err=SyncServerDispatch(&scPB);
  1677.  
  1678.         if (err==noErr)
  1679.             printf("  %#s\n",userName);
  1680.         else
  1681.             if (err!=fnfErr) // fnfErr indicates no more users
  1682.                 printf("\n\n Unexpected error %d.\n",err);
  1683.     } while (err==noErr);
  1684. }
  1685.  
  1686.  
  1687. ============================================================
  1688. Dave Nebinger                    dnebing@andy.bgsu.edu
  1689. Network Manager, Biology Dept.   dnebing@opie.bgsu.edu
  1690. Bowling Green State University   dnebing@bgsuopie (bitnet)
  1691. Bowling Green, OH 43403          #include <std_disclaimer.h>
  1692.  
  1693.             *THE* alt.sources.mac supporter!
  1694.  
  1695.  
  1696. 
  1697. 
  1698. Path: ucivax!gateway
  1699. From: rmah@panix.com ("Robert S. Mah")
  1700. Subject: Re: SCGetUserNameRec vs Parameter Error (fight to the death)
  1701. Message-ID: <9403090324.aa12867@q2.ics.uci.edu>
  1702. Content-Type: text/plain; charset="us-ascii"
  1703. Mime-Version: 1.0
  1704. Newsgroups: fa.think-c
  1705. X-Message-ID: <199403091121.AA12679@panix.com>
  1706. Approved: usenet@q2.ics.uci.edu
  1707. Lines: 31
  1708. Date: 9 Mar 94 11:24:31 GMT
  1709.  
  1710. Dave,
  1711.  
  1712. At  4:09 AM 3/9/94 +0000, Dave Nebinger wrote:
  1713. > In the following code which I have attached below, I am having a problem
  1714. > using the SCGetUserNameRec call.  When I make the SyncServerDispatch call,
  1715. > I always get an OSErr value of -50 (parameter error).
  1716.  
  1717. Do you get this the _first_ time you call ServerDispatch?  If so, I'm not
  1718. sure what the problem is, but if the error occurs _after_ the first time, I
  1719. think it's because you are resetting scPosition to 0 every time.  You
  1720. should leave scPosition alone between calls to ServerDispatch as
  1721. ServerDispatch returns the position of the next user in scPosition after it
  1722. completes.
  1723.  
  1724. In other words, try moving the line...
  1725.  
  1726.  >       scPB.userInfoPB.scPosition=Position;
  1727.  
  1728. Above the line...
  1729.  
  1730.  >   do {
  1731.  
  1732. I'm not absolutely sure here, but everything else looks kosher.
  1733.  
  1734. Cheers,
  1735. Rob
  1736.  
  1737. ____________________________________________________________________________
  1738.  Robert S. Mah                  One Step Beyond              rmah@panix.com
  1739.  
  1740.  
  1741. 
  1742. 
  1743. Path: ucivax!gateway
  1744. From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
  1745. Subject: Checking for valid Handle's?
  1746. Message-ID: <9403090610.aa02066@q2.ics.uci.edu>
  1747. Newsgroups: fa.think-c
  1748. X-Message-ID: <9403091408.AA02936@NADC.NADC.NAVY.MIL>
  1749. Approved: usenet@q2.ics.uci.edu
  1750. Lines: 7
  1751. Date: 9 Mar 94 14:10:30 GMT
  1752.  
  1753. How do I determine if a handle is valid?  If I DisposHandle(theHandle),
  1754. may I then assign NIL to theHandle, and then check to see if theHandle is NIL
  1755. to determine if it is invalid?  I know I can do that with pointers.
  1756.  
  1757. Thanks,
  1758. Barry Kirsch
  1759. bkirsch@nadc.navy.mil
  1760. 
  1761. 
  1762. Path: ucivax!gateway
  1763. From: huff@mcclb0.med.nyu.edu ("Edward J. Huff")
  1764. Subject: Has anyone ported P2C to Think C or MPW?
  1765. X-Sender: huff@mcclb0.med.nyu.edu (Unverified)
  1766. Message-ID: <9403090719.aa05165@q2.ics.uci.edu>
  1767. Content-transfer-encoding: 7BIT
  1768. Newsgroups: fa.think-c
  1769. X-Message-ID: <01H9RJJ1WH1E00339L@MCCLB0.MED.NYU.EDU>
  1770. Approved: usenet@q2.ics.uci.edu
  1771. Lines: 7
  1772. Date: 9 Mar 94 15:19:28 GMT
  1773. X-Envelope-to: think-c@ics.uci.edu
  1774.  
  1775. Has anyone taken the P2C translator available on comp.sources.unix volume
  1776. 21 and used it to convert a Think Pascal program to a Think C (or MPW C)?
  1777. --
  1778. Edward J. Huff   huff@mcclb0.med.nyu.edu   (212)998-8465
  1779. Keck Laboratory for Biomolecular Imaging
  1780. NYU Chemistry Department, 31 Washington Place, New York NY 10003
  1781.  
  1782. 
  1783. 
  1784. Path: ucivax!gateway
  1785. From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
  1786. Subject: File locations?
  1787. Message-ID: <9403090913.aa12617@q2.ics.uci.edu>
  1788. Newsgroups: fa.think-c
  1789. X-Message-ID: <9403091710.AA09364@NADC.NADC.NAVY.MIL>
  1790. Approved: usenet@q2.ics.uci.edu
  1791. Lines: 5
  1792. Date: 9 Mar 94 17:13:04 GMT
  1793.  
  1794. What is the best method to remember where a file (chosen by the user) is located
  1795. for subsequent sessions of the application.
  1796.  
  1797. Thanks,
  1798. Barry Kirsch
  1799. 
  1800. 
  1801. Path: ucivax!gateway
  1802. From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
  1803. Subject: Re: Checking for valid Handle's?
  1804. Message-ID: <9403091028.aa18827@q2.ics.uci.edu>
  1805. Newsgroups: fa.think-c
  1806. X-Message-ID: <9403091826.AA11409@NADC.NADC.NAVY.MIL>
  1807. Approved: usenet@q2.ics.uci.edu
  1808. Lines: 7
  1809. Date: 9 Mar 94 18:28:52 GMT
  1810.  
  1811.  
  1812. Thanks for all of your responses.  I have part of the answer.  I can
  1813. assign NULL to the handle variable, but is there any other way to check
  1814. if a handle is valid without assigning NULL to it to flag it as not valid.
  1815.  
  1816. Thanks,
  1817. Barry Kirsch
  1818. 
  1819. 
  1820. Path: ucivax!gateway
  1821. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  1822. Subject: Re: File locations?
  1823. Message-ID: <9403091330.aa01867@q2.ics.uci.edu>
  1824. In-Reply-To: <9403090913.aa12617@q2.ics.uci.edu>; from "B. Kirsch" at Mar 9, 94 5:13 pm
  1825. X-Mailer: ELM [version 2.3 PL11]
  1826. Newsgroups: fa.think-c
  1827. X-Message-ID: <199403092129.AA25305@tarski.cogsci.uiuc.edu>
  1828. Approved: usenet@q2.ics.uci.edu
  1829. Lines: 14
  1830. Date: 9 Mar 94 21:30:48 GMT
  1831.  
  1832. > What is the best method to remember where a file (chosen by the user)
  1833. > is located for subsequent sessions of the application.
  1834.  
  1835. System 7 - An alias created using the Alias Manager.
  1836. System 6 - If you need to save the info, use volume name, dirID, and
  1837.            file name. If you just need to use it during the current
  1838.        session, use volume reference number, dirID and file name.
  1839.  
  1840. pr
  1841. --
  1842. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  1843. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1844. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1845. Internet: resnick@cogsci.uiuc.edu
  1846. 
  1847. 
  1848. Path: ucivax!gateway
  1849. From: ribtm@ttacs1.ttu.edu (Greg Vaughn)
  1850. Subject: Code resources and global variables
  1851. Message-ID: <9403091401.ab04610@q2.ics.uci.edu>
  1852. Content-transfer-encoding: 7BIT
  1853. Content-type: text/plain; charset="us-ascii"
  1854. MIME-version: 1.0
  1855. Newsgroups: fa.think-c
  1856. X-Message-ID: <01H9RVGE08HE9D503H@ttacs.ttu.edu>
  1857. Approved: usenet@q2.ics.uci.edu
  1858. Lines: 17
  1859. Date: 9 Mar 94 22:01:27 GMT
  1860.  
  1861. I'm interested in writing a code resource for an iterative mathematical
  1862. function to be called every time the program gets a null event, but I'm not
  1863. familiar with writing code resources. The function needs to use an iterated
  1864. loop counter for calculation, but I want the program to be a good Mac
  1865. citizen, so the function is written as a single iteration. I don't want the
  1866. counter to be reset each time the function is called so I need to keep it
  1867. in a global variable. What, if any, are some of the pitfalls of accessing a
  1868. global variable in a code resource?
  1869.  
  1870. Thanks
  1871.    ______
  1872.   /\__  _\                  | Greg Vaughn
  1873.   \/_/\ \/  exas            | Grad Student, Dept. of Physics
  1874.      \ \_\  ech University  | Insulator Research Laboratory
  1875.       \/_/  Lubbock, Texas  | Email: ribtm@ttacs.ttu.edu
  1876.  
  1877.  
  1878. 
  1879. 
  1880. Path: ucivax!gateway
  1881. From: gurgle@netcom.com (Pete Gontier)
  1882. Subject: Re: File locations?
  1883. Message-ID: <9403091848.aa27819@q2.ics.uci.edu>
  1884. In-Reply-To: <9403091330.aa01867@q2.ics.uci.edu> from "Pete Resnick" at Mar 9, 94 09:30:48 pm
  1885. X-Mailer: ELM [version 2.4 PL23]
  1886. Content-Transfer-Encoding: 7bit
  1887. Content-Type: text/plain; charset=US-ASCII
  1888. Content-Length: 740
  1889. MIME-Version: 1.0
  1890. Newsgroups: fa.think-c
  1891. X-Message-ID: <199403100249.SAA23604@mail.netcom.com>
  1892. Approved: usenet@q2.ics.uci.edu
  1893. Lines: 15
  1894. Date: 10 Mar 94 02:48:20 GMT
  1895.  
  1896. > > What is the best method to remember where a file (chosen by the user)
  1897. > > is located for subsequent sessions of the application.
  1898. >
  1899. > System 7 - An alias created using the Alias Manager.
  1900. > System 6 - If you need to save the info, use volume name, dirID, and
  1901. >            file name. If you just need to use it during the current
  1902. >        session, use volume reference number, dirID and file name.
  1903.  
  1904. Volume creation date can also be useful under System 6. It's best used
  1905. along with volume name, of course. One scheme I implemented saved both,
  1906. and (later) looked for the creation date but would settle for the volume
  1907. name. If neither were present, it was time to ask the user.
  1908.  
  1909. --
  1910.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  1911. 
  1912. 
  1913. Path: ucivax!gateway
  1914. From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
  1915. Subject: MacTCP programming Guide.
  1916. Message-ID: <9403100636.aa08817@q2.ics.uci.edu>
  1917. Newsgroups: fa.think-c
  1918. X-Message-ID: <2lnavq$2st@nagos.lif.icnet.uk>
  1919. Approved: usenet@q2.ics.uci.edu
  1920. Organization: Imperial Cancer Research Fund
  1921. Lines: 14
  1922. Date: 10 Mar 94 14:36:56 GMT
  1923.  
  1924.  
  1925. I am looking for a guide to MacTCP programming. There was
  1926. something I read about a host:  seeding.apple.com. I have
  1927. failed to ftp to this site, I get a connection refused
  1928. reply.
  1929.  
  1930. Is there any source for TCP/IP implementation on the Mac.
  1931.  
  1932. I would be very grateful.
  1933.  
  1934. Josh.
  1935. .
  1936.  
  1937.  
  1938. 
  1939. 
  1940. Path: ucivax!gateway
  1941. From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
  1942. Subject: Whatever happened to seeding.apple.com ???
  1943. Message-ID: <9403100639.aa08930@q2.ics.uci.edu>
  1944. Newsgroups: fa.think-c
  1945. X-Message-ID: <2lnb6c$2t5@nagos.lif.icnet.uk>
  1946. Approved: usenet@q2.ics.uci.edu
  1947. Organization: Imperial Cancer Research Fund
  1948. Lines: 12
  1949. Date: 10 Mar 94 14:39:28 GMT
  1950.  
  1951.  
  1952. I have been trying to get to the above host for
  1953. a guide on MacTCP programming but have my connection
  1954. attempts with ftp refused.
  1955.  
  1956. I need some info on TCP/IP implementation on the Mac
  1957. is there anyone out there who knows of any other
  1958. source?
  1959.  
  1960. Josh.
  1961. .
  1962.  
  1963. 
  1964. 
  1965. Path: ucivax!gateway
  1966. From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
  1967. Subject: Whatever happened to seeding.apple.com ????
  1968. Message-ID: <9403100640.aa09017@q2.ics.uci.edu>
  1969. Newsgroups: fa.think-c
  1970. X-Message-ID: <2lnb94$2t9@nagos.lif.icnet.uk>
  1971. Approved: usenet@q2.ics.uci.edu
  1972. Organization: Imperial Cancer Research Fund
  1973. Lines: 11
  1974. Date: 10 Mar 94 14:40:33 GMT
  1975.  
  1976.  
  1977. I have been trying to get to the above host for
  1978. a guide on MacTCP programming but have my connection
  1979. attempts with ftp refused.
  1980.  
  1981. I need some info on TCP/IP implementation on the Mac
  1982. is there anyone out there who knows of any other
  1983. source?
  1984.  
  1985.  
  1986. Josh.
  1987. 
  1988. 
  1989. Path: ucivax!gateway
  1990. From: gurgle@netcom.com (Pete Gontier)
  1991. Subject: Re: MacTCP programming Guide.
  1992. Message-ID: <9403100846.aa14406@q2.ics.uci.edu>
  1993. In-Reply-To: <9403100636.aa08817@q2.ics.uci.edu> from "Joshua Kafeero" at Mar 10, 94 02:36:56 pm
  1994. X-Mailer: ELM [version 2.4 PL23]
  1995. Content-Transfer-Encoding: 7bit
  1996. Content-Type: text/plain; charset=US-ASCII
  1997. Content-Length: 1131
  1998. MIME-Version: 1.0
  1999. Newsgroups: fa.think-c
  2000. X-Message-ID: <199403101646.IAA11325@netcom9.netcom.com>
  2001. Approved: usenet@q2.ics.uci.edu
  2002. Lines: 20
  2003. Date: 10 Mar 94 16:46:19 GMT
  2004.  
  2005. > I am looking for a guide to MacTCP programming. There was something
  2006. > I read about a host: seeding.apple.com. I have failed to ftp to this
  2007. > site, I get a connection refused reply. Is there any source for TCP/IP
  2008. > implementation on the Mac.
  2009.  
  2010. A few months ago I got the same tip and downloaded a MacTCP API
  2011. document. It's in DocViewer format, by the way. I was all excited to
  2012. read this document, but it blew up when I tried to open it. I made sure
  2013. I had the latest DocViewer and tried again. Again it blew up. So I went
  2014. and downloaded another copy of the document from the server. This copy
  2015. blew up, too. Frustrated, I sent a note to the responsible party at the
  2016. site, but I can't remember ever getting anything back. Anyway, this
  2017. is all by way of saying you *may* not be missing out on anything. And
  2018. if anyone has this document and it doesn't blow up when you read it,
  2019. I'm not suggesting you send it to me (because that would probably be
  2020. against Apple's silly redistribution license), but I have a writable
  2021. 'ftp' directory: 'ftp.netcom.com:/pub/gurgle/incoming'.
  2022.  
  2023. --
  2024.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  2025. 
  2026. 
  2027. Path: ucivax!gateway
  2028. From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
  2029. Subject: And now for something completely different
  2030. Message-ID: <9403100857.aa15084@q2.ics.uci.edu>
  2031. In-Reply-To: <9402281838.aa19798@q2.ics.uci.edu>; from "Lance Helsten" at Mar 1, 94 2:38 am
  2032. X-Mailer: ELM [version 2.3 PL2]
  2033. Newsgroups: fa.think-c
  2034. X-Message-ID: <9403101657.AA11968@mozart.aero.ufl.edu>
  2035. Approved: usenet@q2.ics.uci.edu
  2036. Lines: 35
  2037. Date: 10 Mar 94 16:57:22 GMT
  2038.  
  2039.     First, some good news.  My code that uses the Newton-Raphson method
  2040. works!  In fact, I already generated the needed data and sent my paper to
  2041. the AIAA student conference.  Now, I have only to prepare my transparencies
  2042. and wait for the presentation day. :)
  2043.  
  2044. So, now that the code finally works, I can go back to my aventures in
  2045. toolbox programming.  In the previous chapter, my problems with modal
  2046. dialogs and normal windows have been solved.  Nevertheless, I am still
  2047. wondering whether I should put my controls in a modeless dialog or in the
  2048. window itself.  For the sake of today's problem, let's just say I will try
  2049. to put them in the modeless dialog.  I used "try" since it does not work
  2050. according to the plan.
  2051.  
  2052. Initially, I was going to put the modeless dialog on screen in the
  2053. beginning.  So, my algo is something like this:
  2054.  
  2055.  
  2056. DialogPtr gMyDialog; /* Global, defined somewhere else */
  2057.  
  2058. gMyDialog = GetNewDialog(dialogID, NIL_POINTER, MOVE_TO_FRONT);
  2059. ShowWindow(gMyDialog);
  2060.  
  2061. and that is about it.  Since I don't have any use for the dialog yet -- I
  2062. just wanted to see it on the screen -- I did not bother about
  2063. IsDialogEvent() and such.  Well, when I run the code I have the dialog
  2064. window on the screen but with none of its items (buttons, static text, PICT
  2065. resource) visible.  If I click on the dialog, the system crashes.  If I
  2066. open my window (that one I created in the previous chapter) AND THEN click
  2067. on the dialog, nothing happens (no crashes).  Suggestions?
  2068.  
  2069. OLD SHRAPNELL
  2070. --- ---------
  2071.  
  2072. When should I allocate space for a window I will be creating and destrying
  2073. throughout my code:  in the beginning of the code or when I need it?
  2074. 
  2075. 
  2076. Path: ucivax!gateway
  2077. From: morris@wais.com (Harry Morris)
  2078. Subject: unsubscribe morris@wais.com
  2079. Message-ID: <9403101018.aa20210@q2.ics.uci.edu>
  2080. Newsgroups: fa.think-c
  2081. X-Message-ID: <9403101818.AA01251@sushi>
  2082. Approved: usenet@q2.ics.uci.edu
  2083. Lines: 2
  2084. Date: 10 Mar 94 18:18:52 GMT
  2085.  
  2086.  
  2087. unsubscribe morris@wais.com
  2088. 
  2089. 
  2090. Path: ucivax!gateway
  2091. From: FEATS@vtvm1.cc.vt.edu (Steve Greenfield)
  2092. Subject: CopyBits (Off-Screen to Print)
  2093. Message-ID: <9403101230.aa00559@q2.ics.uci.edu>
  2094. Newsgroups: fa.think-c
  2095. X-Message-ID: <9403101230.aa00559@q2.ics.uci.edu>
  2096. Approved: usenet@q2.ics.uci.edu
  2097. Lines: 47
  2098. Date: 10 Mar 94 20:30:33 GMT
  2099.  
  2100. I have written a routine which creates an off-screen GrafPort to draw
  2101. into.  I draw my bit images into this off-screen GrafPort and then use
  2102. copybits to copy from off-screen GrafPort to print GrafPort.  My routine
  2103. works just fine (after much work).  This is how I declare and load my
  2104. pointer to the off-screen port structure:
  2105.  
  2106.           GrafPtr     gNewPort;
  2107.  
  2108.           gNewPort = (GrafPtr)NewPtr(sizeof(GrafPort));
  2109.  
  2110. This is how I declare and load my pointer to the print port structure:
  2111.  
  2112.           TPPrPort    printPort;
  2113.  
  2114.           printPort = PrOpenDoc( gPrintRecordH, NIL_POINTER, NIL_POINTER);
  2115.  
  2116. And this is how I use CopyBits to copy from the off-screen GrafPort to
  2117. the print GrafPort:
  2118.  
  2119.           CopyBits(&gNewPort->portBits,&thePort->portBits,
  2120.                     &srcRect,&destRect,srcCopy,0L);
  2121.  
  2122. The address of the destination BitMap (&thePort->portBits) is used because
  2123. at the time of the CopyBits invocation the print GrafPort is the current
  2124. active GrafPort.
  2125.  
  2126. To get a better understanding of how things work, I decided to try and
  2127. change the destination BitMap parameter to indicate the print GrafPort
  2128. directly (printPort) instead of 'thePort' (current active GrafPort).  I
  2129. have tried by changing '&thePort->portBits' to the following:
  2130.  
  2131.           &printPort->gPort.portBits           (*)
  2132.  
  2133.           printPort->gPort.portBits
  2134.  
  2135.           &printPort->portBits
  2136.  
  2137.           (GrafPtr)&printPort->gPort.portBits
  2138.  
  2139. I've probably tried many others as well.  Nothing works and I don't
  2140. understand why!  I thought for sure that the first one (*) above
  2141. would work.  Will anything work or should I just stick with
  2142. '&thePort->portBits' ???  Thanks for any help/advice!
  2143.  
  2144.  
  2145.  
  2146. /steve greenfield <feats@vtvm1.cc.vt.edu>
  2147. 
  2148. 
  2149. Path: ucivax!gateway
  2150. From: dittmer@fokus.uke.uni-hamburg.de (Ulf Dittmer)
  2151. Subject: Beginners question
  2152. Message-ID: <9403101340.aa05490@q2.ics.uci.edu>
  2153. X-Vms-Cc: DITTMER
  2154. Newsgroups: fa.think-c
  2155. X-Message-ID: <9403102140.AA02554@fbihh.informatik.uni-hamburg.de>
  2156. Approved: usenet@q2.ics.uci.edu
  2157. X-Vms-To: SMTP%"think-c@ics.uci.edu"
  2158. Lines: 17
  2159. Date: 10 Mar 94 21:40:50 GMT
  2160.  
  2161. Dear THINKers,
  2162.  
  2163. I just start to work with Think C and to read this list so please
  2164. forgive if I am doing anything wrong.
  2165.  
  2166. I tried to compile a few old sources I got and they have lines like
  2167. #include <MenuMgr.h>
  2168. all over the place. The names of the Think Header files are slightly
  2169. different, e.g. Menus.h. I don't want to change all my files (I have
  2170. to use them with MPW also), so what can I do besides creating an
  2171. alias of MenuMgr.h named Menus.h ?
  2172. The manual mentions the MacHeaders file but I don't want to comment
  2173. out all the #include lines. Am I missing something obvious ?
  2174. Many thanks in advance for any help in this.
  2175.  
  2176. Greetings,    Ulf
  2177. dittmer@uke.uni-hamburg.de
  2178. 
  2179. 
  2180. Path: ucivax!gateway
  2181. From: gurgle@netcom.com (Pete Gontier)
  2182. Subject: Re: Speaking of docviewer...
  2183. Message-ID: <9403101534.aa14552@q2.ics.uci.edu>
  2184. In-Reply-To: <199403102233.RAA19157@hobbes> from "Jason A. Bobier" at Mar 10, 94 05:33:54 pm
  2185. X-Mailer: ELM [version 2.4 PL23]
  2186. Content-Transfer-Encoding: 7bit
  2187. Content-Type: text/plain; charset=US-ASCII
  2188. Content-Length: 407
  2189. MIME-Version: 1.0
  2190. Newsgroups: fa.think-c
  2191. X-Message-ID: <199403102335.PAA21014@netcom9.netcom.com>
  2192. Approved: usenet@q2.ics.uci.edu
  2193. Lines: 11
  2194. Date: 10 Mar 94 23:34:31 GMT
  2195.  
  2196. > > A few months ago I got the same tip and downloaded a MacTCP API
  2197. > > document. It's in DocViewer format, by the way. I was all excited to
  2198. >
  2199. > Speaking of DocViewer, does anyone know if there is a utility around to
  2200. > create DocViewer documents?
  2201.  
  2202. You can license it from Apple. It's expensive. Try email to
  2203. sw.license@applelink.apple.com.
  2204.  
  2205. --
  2206.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  2207. 
  2208. 
  2209. Path: ucivax!gateway
  2210. From: walrathw@rferl.org (WalrathW)
  2211. Subject: RE: And now for something completely different
  2212. Message-ID: <9403102325.aa05428@q2.ics.uci.edu>
  2213. Content-transfer-encoding: 7BIT
  2214. Content-type: TEXT/PLAIN; CHARSET=US-ASCII
  2215. Newsgroups: fa.think-c
  2216. X-Message-ID: <01H9U85EUA2Q8WW6OX@MUVAXA.RFERL.ORG>
  2217. Approved: usenet@q2.ics.uci.edu
  2218. Lines: 50
  2219. Date: 11 Mar 94 07:25:29 GMT
  2220.  
  2221. > Initially, I was going to put the modeless dialog on screen in the
  2222. > beginning.  So, my algo is something like this:
  2223. >
  2224. >
  2225. > DialogPtr gMyDialog; /* Global, defined somewhere else */
  2226. >
  2227. > gMyDialog = GetNewDialog(dialogID, NIL_POINTER, MOVE_TO_FRONT);
  2228. > ShowWindow(gMyDialog);
  2229. >
  2230. > and that is about it.  Since I don't have any use for the dialog yet
  2231. > -- I
  2232. > just wanted to see it on the screen -- I did not bother about
  2233. > IsDialogEvent() and such.  Well, when I run the code I have the dialog
  2234. > window on the screen but with none of its items (buttons, static text,
  2235. > PICT
  2236. > resource) visible.  If I click on the dialog, the system crashes.  If
  2237. > I
  2238. > open my window (that one I created in the previous chapter) AND THEN
  2239. > click
  2240. > on the dialog, nothing happens (no crashes).  Suggestions?
  2241.  
  2242. I think the problem with it crashing is because you probably need to SetPort to
  2243. the dialog, since your code may be trying to handle your mouseDown event, but
  2244. without the port set properly. That I'm not certain about, but it sounds like
  2245. what's happening.
  2246.  
  2247. As for not seeing any of your DITL elements in the dialog, I would guess that's
  2248. because you aren't giving the Dialog Manager a single chance to update itself.
  2249. By not calling IsDialogEvent even a single time, there is an updateEvt for your
  2250. dialog not getting handled.
  2251.  
  2252. Mauricio, I have a suggestion to make. There is source code out on the nets
  2253. from the book "Macintosh Programming Secrets" (Knaster & Rollin), and it
  2254. contains several different mini-programs, all based on the same shell. One of
  2255. the apps contains code to handle three different kinds of dialogs: There is a
  2256. modal dialog with a dozen or more different items, a Movable Modal progress bar
  2257. (exactly like the Finder's copy dialog), and a modeless dialog with two popup
  2258. menus in it. Another one of the shells has support for multiple windows,
  2259. including zooming rectangles, and "Cleaning Up" the windows (resizing and
  2260. positioning them in some organized way).  If you are struggling with some of
  2261. these basic toolbox elements, play around with the MPS shell (and pick up a
  2262. copy of the book next time you're in a bookstore) to see how it's done.
  2263.  
  2264. You can ftp the MPS sources from the umich archives, or one of the sumex
  2265. mirrors (since Sumex is probably still rebuilding). If you don't find it, I'll
  2266. send it to you.
  2267.  
  2268. cheers,
  2269.  
  2270.   -wayne
  2271. 
  2272. 
  2273. Path: ucivax!gateway
  2274. From: dh@dapsun.lif.icnet.uk (Davis Holland)
  2275. Subject: Help with displaying the Apple Symbol.
  2276. Message-ID: <9403110531.aa02272@q2.ics.uci.edu>
  2277. Newsgroups: fa.think-c
  2278. X-Message-ID: <2lprhh$35a@nagos.lif.icnet.uk>
  2279. Approved: usenet@q2.ics.uci.edu
  2280. Organization: Imperial Cancer Research Fund
  2281. Lines: 10
  2282. Date: 11 Mar 94 13:31:15 GMT
  2283.  
  2284.  
  2285. I need some very elementary help with displaying
  2286. the Apple Symbol in Think C.
  2287.  
  2288. I know Pascal would use the CHR(AppleMark); command.
  2289. What is the equivalent in Think C?
  2290.  
  2291. Any offers?
  2292.  
  2293. Davis.
  2294. 
  2295. 
  2296. Path: ucivax!gateway
  2297. From: gurgle@netcom.com (Pete Gontier)
  2298. Subject: Re: Help with displaying the Apple Symbol.
  2299. Message-ID: <9403110925.aa14908@q2.ics.uci.edu>
  2300. X-Mailer: ELM [version 2.4 PL23]
  2301. Content-Transfer-Encoding: 7bit
  2302. Content-Type: text/plain; charset=US-ASCII
  2303. Content-Length: 3255
  2304. MIME-Version: 1.0
  2305. Newsgroups: fa.think-c
  2306. X-Message-ID: <199403111725.JAA11000@mail.netcom.com>
  2307. Approved: usenet@q2.ics.uci.edu
  2308. Lines: 81
  2309. Date: 11 Mar 94 17:25:09 GMT
  2310.  
  2311. Davis:
  2312.  
  2313. It appears that your system is producing a bad return address for you.
  2314. This is the second time this has happened to me in attempting to send
  2315. you mail. Along with my answer, I am including the mail headers I got
  2316. back from my failed mail to you because (obviously) I can't send them to
  2317. you in mail. Note the message seems to indicate that your apparent host
  2318. (dapsun.lif.icnet.uk) exists but that it does not know who you (dh) are.
  2319.  
  2320. > From Mailer-Daemon Fri Mar 11 08:05:42 1994
  2321. > Date: Fri, 11 Mar 1994 08:05:42 -0800
  2322. > From: Mailer-Daemon (Mail Delivery Subsystem)
  2323. > Subject: Returned mail: User unknown
  2324. > Message-Id: <199403111605.IAA13524@netcom9.netcom.com>
  2325. > To: gurgle
  2326. >
  2327. > The original message was received at Fri, 11 Mar 1994 08:05:18 -0800
  2328. > from gurgle@localhost
  2329. >
  2330. >    ----- The following addresses had delivery problems -----
  2331. > dh@dapsun.lif.icnet.uk  (unrecoverable error)
  2332. >
  2333. >    ----- Transcript of session follows -----
  2334. > ... while talking to dapsun.lif.icnet.uk.:
  2335. > >>> RCPT To:<dh@dapsun.lif.icnet.uk>
  2336. > <<< 550 <dh@dapsun.lif.icnet.uk>... User unknown
  2337. > 550 dh@dapsun.lif.icnet.uk... User unknown
  2338. >
  2339. >    ----- Original message follows -----
  2340. > Return-Path: <gurgle>
  2341. > Received: from localhost by netcom9.netcom.com (8.6.4/SMI-4.1/Netcom)
  2342. >     id IAA13522; Fri, 11 Mar 1994 08:05:18 -0800
  2343. > From: gurgle (Pete Gontier)
  2344. > Message-Id: <199403111605.IAA13522@netcom9.netcom.com>
  2345. > Subject: Re: Help with displaying the Apple Symbol.
  2346. > To: dh@dapsun.lif.icnet.uk (Davis Holland)
  2347. > Date: Fri, 11 Mar 1994 08:05:17 -0800 (PST)
  2348. > In-Reply-To: <9403110531.aa02272@q2.ics.uci.edu> from "Davis Holland" at Mar 11, 94 01:31:15 pm
  2349. > X-Mailer: ELM [version 2.4 PL23]
  2350. > MIME-Version: 1.0
  2351. > Content-Type: text/plain; charset=US-ASCII
  2352. > Content-Transfer-Encoding: 7bit
  2353. > Content-Length: 1379
  2354. >
  2355. > > I need some very elementary help with displaying the Apple Symbol in
  2356. > > Think C. I know Pascal would use the CHR(AppleMark); command. What is
  2357. > > the equivalent in Think C?
  2358. >
  2359. > C is weakly typed. That means that every integer constant less than
  2360. > 256 and greater than -1 can also be an unsigned character constant.
  2361. > (In fact, C is so weakly typed that any number type can be used as a
  2362. > character -- but C will quietly truncate the number if it is too big or
  2363. > too small.) Say you have a function prototype:
  2364. >
  2365. >     void foo (unsigned char x);
  2366. >
  2367. > You can call this function in two ways which interest us:
  2368. >
  2369. >     foo ('b'); foo (98);
  2370. >
  2371. > Both calls do exactly the same thing because 98 is the ASCII code for
  2372. > 'b'. What this means is you don't have to typecast the 98. (In Pascal,
  2373. > the CHR call is basically a typecast with more safety; I believe it
  2374. > won't allow you to pass a REAL, for example.)
  2375. >
  2376. > Since the standard Mac C header <Fonts.h> declares:
  2377. >
  2378. >     enum { appleMark = 20  };
  2379. >
  2380. > ...you can just do:
  2381. >
  2382. >     foo (appleMark);
  2383. >
  2384. > Note that in C, an 'enum' is just a fancy way to say CONST. (C also
  2385. > supports a 'const' keyword. A third way to do this would have been
  2386. > to '#define appleMark 20'.) People try to use 'enum's like Pascal
  2387. > enumerated types, but the compiler doesn't enforce anything. The
  2388. > situation is a little bit better in C++, but only a little.
  2389.  
  2390. --
  2391.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  2392. 
  2393. 
  2394. Path: ucivax!gateway
  2395. From: chharris@u.washington.edu (The Only Cow)
  2396. Subject: GWorld Trouble....
  2397. X-Sender: chharris@stein2.u.washington.edu
  2398. Message-ID: <9403130854.aa27570@q2.ics.uci.edu>
  2399. Content-Type: TEXT/PLAIN; charset=US-ASCII
  2400. Mime-Version: 1.0
  2401. Newsgroups: fa.think-c
  2402. X-Message-ID: <Pine.3.89.9403130802.A18094-0100000@stein2.u.washington.edu>
  2403. Approved: usenet@q2.ics.uci.edu
  2404. Lines: 66
  2405. Date: 13 Mar 94 16:54:20 GMT
  2406.  
  2407. Thanks to all those who replied to my GWorld stuff....  It took me a
  2408. while to find some sort of entry-level code....
  2409.  
  2410. I've managed to create GWorld's that mainly do what I want, except I
  2411. can't creat enough of 'em....  Here's a little snippet....
  2412.  
  2413. #include <QDOffscreen.h>
  2414.  
  2415. Rect            gShipRect, gOffscreenShipRect;
  2416.  
  2417. void    SetupGWorlds( void )
  2418. {
  2419.     GetGWorld( &gCurrPort, &gCurrDev );
  2420.  
  2421.     // Setup Background
  2422.     iErr = NewGWorld( &gBackground, 0, &screenSize, nil, nil, 0 );
  2423.  
  2424.     if (!iErr) {
  2425.         LockPixels ( gBackground->portPixMap );
  2426.         SetGWorld ( gBackground, NULL );
  2427.  
  2428.         FillRect( &screenSize, black );
  2429.  
  2430.         UnlockPixels ( gBackground->portPixMap );
  2431.     }
  2432.  
  2433.     // Setup Ship
  2434.     iErr = NewGWorld( &gShip, 0, &gOffscreenShipRect, nil, nil, 0 );
  2435.  
  2436.     if (!iErr) {
  2437.         LockPixels ( gShip->portPixMap );
  2438.         SetGWorld ( gShip, NULL );
  2439.  
  2440.         gShipPict = GetPicture( 128 );
  2441.         DrawPicture( gShipPict, &gOffscreenShipRect );
  2442.  
  2443.         UnlockPixels ( gShip->portPixMap );
  2444.     }
  2445.  
  2446.     // Setup Workspace
  2447.     iErr = NewGWorld( &gWorkspace, 0, &screenSize, nil, nil, 0 );
  2448.  
  2449.     if (!iErr) {
  2450.         LockPixels ( gWorkspace->portPixMap );
  2451.         SetGWorld ( gWorkspace, NULL );
  2452.         EraseRect( &screenSize );
  2453.  
  2454.         UnlockPixels ( gWorkspace->portPixMap );
  2455.     }
  2456.     SetGWorld ( gCurrPort, gCurrDev );
  2457. }
  2458.  
  2459. Everything works okay, until I try to create the gWorkspace GWorld.  At
  2460. that point, it complains to me about an impropper bit depth, even though
  2461. the depth is the same as the other calls....  Any ideas?
  2462.  
  2463. Thanks.
  2464.  
  2465. -Chris
  2466.  
  2467. _____________________________________________________________________________
  2468. "You're only guarenteed one life in this   | Chris Harris / RAMP Productions
  2469. world, so you may as well make the most of |    chharris@u.washington.edu
  2470. it....  Have a nice day or I'll kill you." | Finger me for my PGP public key
  2471.  
  2472.  
  2473. 
  2474. 
  2475. Path: ucivax!gateway
  2476. From: bruno.besace@utopia.fnet.fr (Bruno Besace)
  2477. Subject: Documentation to developp external module for  Wavicle 1.0
  2478. X-Sender: FBB@utopia.fnet.fr
  2479. Message-ID: <9403131112.aa01933@q2.ics.uci.edu>
  2480. Content-Type: text/plain; charset="us-ascii"
  2481. Mime-Version: 1.0
  2482. Newsgroups: fa.think-c
  2483. X-Message-ID: <199403131911.AA15935@indus.fnet.fr>
  2484. Approved: usenet@q2.ics.uci.edu
  2485. Lines: 17
  2486. Date: 13 Mar 94 19:12:23 GMT
  2487.  
  2488. I come to discover the software shareware Wavicle 1.0 of Lee Fyock.
  2489.  
  2490. It is a software of sound processing of open structure allows to develop
  2491. external processing modules.
  2492.  
  2493. I would be delighted that a developper could provide me information for
  2494. developper of external modules.
  2495.  
  2496. Thank you, in advance, the assistance that you will be to even to bring me.
  2497.  
  2498.  
  2499. --
  2500.  
  2501. Bruno Besace.
  2502. bruno.besace@fnet.fr
  2503.  
  2504.  
  2505. 
  2506. 
  2507. Path: ucivax!gateway
  2508. From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
  2509. Subject: Re: CopyBits (Off-Screen to Print)
  2510. Message-ID: <9403140558.aa00275@q2.ics.uci.edu>
  2511. Newsgroups: fa.think-c
  2512. X-Message-ID: <9403141356.AA08478@mailrus.cc.umich.edu>
  2513. Approved: usenet@q2.ics.uci.edu
  2514. Lines: 121
  2515. Date: 14 Mar 94 13:58:04 GMT
  2516.  
  2517. Steve, don't you also need to allocate memory for the bitmap you will be
  2518. copying into? Here's is a routine from an XCMD I wrote that draws an animated
  2519. sine wave. It creates an offscreen bitmap and draws the sine wave into it.
  2520. Then it copies bits form the offscreen bitmap onto the screen. The code is a
  2521. little old so I hope it's accurate:
  2522.  
  2523. void
  2524. SineWave(Rect *destRect, unsigned amplitude, unsigned wavelength, short
  2525. penwidth, RGBColor *color)
  2526. {
  2527.     short        width, height, extra, offset;
  2528.     short        x, y;
  2529.     BitMap        bitMap;
  2530.     GrafPort    grafPort, *oldPort, *newPort;
  2531.     CGrafPort    colorPort;
  2532.     Rect        srcRect;
  2533.     CursHandle    watch;
  2534.     RGBColor    oldColor;
  2535.  
  2536.     watch = GetCursor(watchCursor);
  2537.     if (watch != (CursHandle)0)
  2538.         SetCursor(*watch);
  2539.  
  2540.     width = destRect->right - destRect->left;
  2541.     height = destRect->bottom - destRect->top;
  2542.  
  2543.     /* We need a bit of extra wave to animate */
  2544.     extra = wavelength;
  2545.  
  2546.     GetPort(&oldPort); /* get the current grafport */
  2547.  
  2548.     // Steve, here the bitmap is allocated.
  2549.     bitMap.rowBytes = ((width + extra + 15) / 16) * 2;
  2550.       SetRect(&bitMap.bounds, 0, 0, width + extra, height);
  2551.     bitMap.baseAddr = NewPtrClear((long)(bitMap.rowBytes * height));
  2552.  
  2553.     if (bitMap.baseAddr != 0L) {
  2554.         OpenPort(&grafPort); /* create a new, temporary grafport */
  2555.         SetPortBits(&bitMap); /* set the portBits to our bitmap */
  2556.         BlockMove((Ptr) &bitMap.bounds, (Ptr) &grafPort.portRect, sizeof(Rect));
  2557.         RectRgn(grafPort.visRgn, &bitMap.bounds);
  2558.         SetPort(&grafPort); /* use our port */
  2559.  
  2560.         /* Draw the sine wave */
  2561.  
  2562.         PenSize(penwidth, penwidth);
  2563.         MoveTo(0, height/2);
  2564.  
  2565.         for (x = 0; x < width + extra; x++) {
  2566.             y = (short)(amplitude * sin(x * (2.0 * PI)/wavelength));
  2567.             LineTo(x, height/2 - y);
  2568.         }
  2569.  
  2570.         SetPort(oldPort); /* restore the old port before disposing our ours! */
  2571.         ClosePort(&grafPort); /* so that the port memory is released */
  2572.  
  2573.         /* Now animate until mouseClick */
  2574.  
  2575.         if (HasColor()) {
  2576.  
  2577.             GetForeColor(&oldColor);
  2578.  
  2579.             /* If the port is color, then use it */
  2580.             if ( ((CGrafPtr)oldPort)->portVersion & 0xc000 ) {
  2581.                 RGBForeColor(color);
  2582.                 newPort = oldPort;
  2583.             }
  2584.  
  2585.             /* Else, create a new color port */
  2586.             else {
  2587.                 OpenCPort(&colorPort);
  2588.                 colorPort.portRect = oldPort->portRect;
  2589.                 (**(colorPort.portPixMap)).bounds = oldPort->portBits.bounds;
  2590.                 SetPort(&colorPort); /* use our port */
  2591.                 RGBForeColor(color);
  2592.                 newPort = (GrafPtr)&colorPort;
  2593.             }
  2594.  
  2595.         }
  2596.         else
  2597.             newPort = oldPort;
  2598.  
  2599.         SetRect(&srcRect, 0, 0, width, height);
  2600.         offset = 0;
  2601.  
  2602.         InitCursor();
  2603.  
  2604.         while (!Button()) {
  2605.             srcRect.left = offset;
  2606.             srcRect.right = srcRect.left + width;
  2607.  
  2608.             CopyBits(&bitMap, &newPort->portBits, &srcRect, destRect, srcCopy, 0L);
  2609.             offset = (offset + 1) % extra;
  2610.         }
  2611.  
  2612.         if (newPort != oldPort) {
  2613.             SetPort(oldPort);
  2614.             ClosePort(newPort);
  2615.         }
  2616.  
  2617.         if ( ((CGrafPtr)oldPort)->portVersion & 0xc000 )
  2618.             RGBForeColor(&oldColor);
  2619.  
  2620.         DisposPtr(bitMap.baseAddr); /* dispose of our off-screen bitmap memory */
  2621.     }
  2622.     else
  2623.         SysBeep(10);    /* Not enough memory */
  2624. }
  2625.  
  2626.  
  2627.  ------ From: Steve Greenfield, Thu, Mar 10, 1994 ------
  2628.  
  2629. I have written a routine which creates an off-screen GrafPort to draw
  2630. into.  I draw my bit images into this off-screen GrafPort and then use
  2631. copybits to copy from off-screen GrafPort to print GrafPort.  My routine
  2632. works just fine (after much work).  This is how I declare and load my
  2633. pointer to the off-screen port structure:
  2634.  
  2635.           GrafPtr     gNewPort;
  2636.  
  2637.  
  2638. 
  2639. 
  2640. Path: ucivax!gateway
  2641. From: jaha@secrc.abb.se ("Jan R. M. Rohman")
  2642. Subject: memory allocation
  2643. Message-ID: <9403170142.aa00587@q2.ics.uci.edu>
  2644. Newsgroups: fa.think-c
  2645. X-Message-ID: <9403170933.AA07953@kbmhp1.secrc.abb.se>
  2646. Reply-To: jaha@secrc.abb.se
  2647. Approved: usenet@q2.ics.uci.edu
  2648. Lines: 19
  2649. Date: 17 Mar 94 09:42:38 GMT
  2650.  
  2651.  
  2652. Hi,
  2653.  
  2654. Im' writing a program for solving systems of linear equations.
  2655. In the code I want to use malloc() to allocate memory for the
  2656. matrices and vectors. My question is:
  2657.  
  2658. When I call malloc(), are the needed memory taken from the
  2659. application memory set from the dialog "Set Application Type..." in
  2660. Think C or outside this memory area?
  2661.  
  2662. ----------------------------------------------------------------------
  2663.  From:    jaha@secrc.abb.se  Jan R. M. Rohman                          !
  2664.  Phone:    +46 21 32 31 48       ABB Corporate Research Center Dept. KF    !
  2665.  Fax:    +46 21 32 31 01       Department of Computational Methods,      !
  2666.                            Electromagnetic Fields and Fluid Dynamics !
  2667.                            S-721 78 Vasteras, SWEDEN                 !
  2668.  Home:   Vasagatan 35, 722 15 Vasteras, Phone:  +46 21 83 06 00      !
  2669. ----------------------------------------------------------------------
  2670. 
  2671. 
  2672. Path: ucivax!gateway
  2673. From: vince_paragano@maca.sarnoff.com (Vince Paragano)
  2674. Subject: Talking to an ImageWriter d
  2675. Message-ID: <9403170634.aa23743@q2.ics.uci.edu>
  2676. Newsgroups: fa.think-c
  2677. X-Message-ID: <9403171433.AA01546@nova.sarnoff.com>
  2678. Approved: usenet@q2.ics.uci.edu
  2679. Lines: 21
  2680. Date: 17 Mar 94 14:34:18 GMT
  2681.  
  2682.  Talking to an ImageWriter directly from_
  2683. Hi,
  2684. I'm trying to send raw bytes (printing chars and escape sequences) to an
  2685. ImageWriter printer from my Mac Classic (sys 6.0.7) using ThinkC.  Used an
  2686. example from the on-line Think C Reference...
  2687. hooked-up an RS-232 break-out-box and see bytes flickering across to the
  2688. printer.  However, the printer never prints anything.  I've tried sending like
  2689. thousands of bytes so I know it's not the printer's buffer not being full.
  2690. What's going on?  Ayone know how to do this or better yet have some sample code
  2691. to do it?!  I don't want to use the printer driver as I might go with
  2692. non-quickdraw printers in the future in my application.  Any help would be
  2693. greatly appreciated.
  2694. Thanks in advance,
  2695. -Vince
  2696.  
  2697. Vince Paragano
  2698. David Sarnoff Research Center
  2699. Princeton, NJ 08540
  2700. (609) 734-2580
  2701.  
  2702.  
  2703. 
  2704. 
  2705. Path: ucivax!gateway
  2706. From: mxmora@unix.sri.com (Matthew Xavier Mora)
  2707. Subject: Re: Talking to an ImageWriter d
  2708. Message-ID: <9403170941.aa06593@q2.ics.uci.edu>
  2709. Content-Type: text/plain; charset="us-ascii"
  2710. Mime-Version: 1.0
  2711. Newsgroups: fa.think-c
  2712. X-Message-ID: <9403171742.AB20971@unix.sri.com>
  2713. Approved: usenet@q2.ics.uci.edu
  2714. Lines: 29
  2715. Date: 17 Mar 94 17:41:46 GMT
  2716.  
  2717. > Talking to an ImageWriter directly from_
  2718. >Hi,
  2719. >I'm trying to send raw bytes (printing chars and escape sequences) to an
  2720. >ImageWriter printer from my Mac Classic (sys 6.0.7) using ThinkC.  Used an
  2721. >example from the on-line Think C Reference...
  2722. >hooked-up an RS-232 break-out-box and see bytes flickering across to the
  2723. >printer.  However, the printer never prints anything.  I've tried sending like
  2724. >thousands of bytes so I know it's not the printer's buffer not being full.
  2725. >What's going on?  Ayone know how to do this or better yet have some sample code
  2726. >to do it?!  I don't want to use the printer driver as I might go with
  2727. >non-quickdraw printers in the future in my application.  Any help would be
  2728. >greatly appreciated.
  2729. >Thanks in advance,
  2730.  
  2731.  
  2732. Try text streaming. Most printer drivers support a call that lets you send
  2733. ascii text to the printer.
  2734.  
  2735. Matt
  2736.  
  2737. __________________________________________________________________
  2738. Matthew Xavier Mora  (cybernaut)            The keeper of the UMPG
  2739. SRI International                              mxmora@unix.sri.com
  2740. [Sent using Eudora 2.0.2]                     Matt_Mora@QM.sri.com
  2741.  "Thanks to Apple Computers, it's Bitchin what these things can
  2742.   do." Tori Amos
  2743. __________________________________________________________________
  2744.  
  2745.  
  2746. 
  2747. 
  2748. Path: ucivax!gateway
  2749. From: crawford@scipp.ucsc.edu (Mike Crawford)
  2750. Subject: Re: memory allocation
  2751. Message-ID: <9403171101.aa17642@q2.ics.uci.edu>
  2752. In-Reply-To: <9403170142.aa00587@q2.ics.uci.edu>; from "Jan R. M. Rohman" at Mar 17, 94 9:42 am
  2753. X-Mailer: ELM [version 2.3 PL11]
  2754. Newsgroups: fa.think-c
  2755. X-Message-ID: <199403171903.AA19746@scipp.ucsc.edu>
  2756. Approved: usenet@q2.ics.uci.edu
  2757. Lines: 62
  2758. Date: 17 Mar 94 19:01:55 GMT
  2759.  
  2760. Jan Rohman writes,
  2761.  
  2762. > When I call malloc(), are the needed memory taken from the
  2763. > application memory set from the dialog "Set Application Type..." in
  2764. > Think C or outside this memory area?
  2765.  
  2766. Jan,
  2767.  
  2768. Presumably the reason that you are asking about this is that you have some
  2769. existing code that uses malloc().  With this assumption, let us avoid the
  2770. ansi-vs-mac flame war of a few months ago.
  2771.  
  2772. The malloc that is given in the Think C library gets its memory from the
  2773. application heap (as specified in Set Application Type).  However, the malloc
  2774. that is provided is quite buggy and should not be used for any purpose more
  2775. serious than getting your code to compile.
  2776.  
  2777. The reason is that malloc allocates large blocks that are never, ever
  2778. freed (or not while your application is running).  When you call free() to
  2779. free some malloc'ed memory, the memory is freed from malloc's tables but is
  2780. not returned to the Macintosh memory manager.
  2781.  
  2782. To deal with this, replace the ANSI library with your own.  Start by adding
  2783. the C source files that are in the C Libraries:sources folder to your
  2784. application, and removing whatever ANSI library you presently use.  Get it to
  2785. compile and run.
  2786.  
  2787. (I recommend doing this by adding one file at a time and checking the link.
  2788. You are likely to find that you can cut down on the library size quite a bit.)
  2789.  
  2790. Next, remove the source file that includes malloc, and replace it with one
  2791. like this.  You will need to fix up the prototypes:
  2792.  
  2793. void *malloc( size_t theSize )
  2794. {
  2795.     return NewPtr( theSize );
  2796. }
  2797.  
  2798. void free( void *thePtr )
  2799. {
  2800.     DisposHandle( thePtr );
  2801. }
  2802.  
  2803. This will have the added benefit of allowing you to use the leaks dcmd in
  2804. Macsbug to find memory leaks quickly.
  2805.  
  2806. Accept the voice of hard experience: just say no to Think C's ANSI code.
  2807. If you must use it, write your own.  Some undergrad who wants a good term
  2808. project ought to write one and upload it to ics.uci.edu.
  2809.  
  2810. BTW, the exit() call in Think C will cause any code resource to crash.
  2811. In particular, if you use stdio, and you exit by falling off the end of
  2812. main(), you will crash later on.  This is because Think C patches the
  2813. ExitToShell trap to call a procedure that closes stdio files and runs any
  2814. tasks that have been scheduled by the atexit() call.  If you use stdio from
  2815. a code resource, comment off the patch code in the Think C source (make
  2816. your own copy first, of course)
  2817.  
  2818. Mike Crawford           | Author of the Word Services Apple Event Suite.
  2819. crawford@scipp.ucsc.edu | Free Mac Source Code: ftp sumex-aim.stanford.edu
  2820.                         | get /info-mac/dev/src/writeswell-jr-102-c.hqx
  2821.  
  2822. 
  2823. 
  2824. Path: ucivax!gateway
  2825. From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
  2826. Subject: Think C++ bug
  2827. Message-ID: <9403171547.aa16982@q2.ics.uci.edu>
  2828. Content-Type: TEXT/PLAIN; charset=US-ASCII
  2829. MIME-Version: 1.0
  2830. Newsgroups: fa.think-c
  2831. X-Message-ID: <Pine.3.07.9403171611.A18407-a100000@u.cc.utah.edu>
  2832. Approved: usenet@q2.ics.uci.edu
  2833. Lines: 35
  2834. Date: 17 Mar 94 23:47:01 GMT
  2835.  
  2836.  
  2837. Does anyone know Symantec tech support e-mail address?
  2838.  
  2839. Found a bug that is in the dusty corners of Think C++. If you are using
  2840. inline assembly code with a #pragma parameter it will corrupt data randomly.
  2841.  
  2842. e.g.
  2843.     void myproc () {
  2844.         jmp_buf theBuf;
  2845.  
  2846.         if(setjmp(theBuf) == 0) {
  2847.             //...
  2848.         }
  2849.     }
  2850.  
  2851. results in this code
  2852.  
  2853.     //...
  2854.         pea    theBuf(a6)        ;last myproc instruction
  2855.         move.l    #0,d0            ;first setjmp instruction
  2856.         lea    @1,a1
  2857.         move.l    d3-d7/a1-a4/a7,(a0)    ;notice a0 can be anything
  2858.     @1
  2859.     //...
  2860.  
  2861. For some reason the #pragma parameter __D0 setjmp(__A0) is not working in
  2862. Think C++. So if you use any of these type of functions then add
  2863. Move.l (SP)+,A0 before the move.l in setjmp (each function will have to be
  2864. looked at individually).
  2865.  
  2866. I hope this helps.
  2867.  
  2868. Lance
  2869.  
  2870.  
  2871. 
  2872. 
  2873. Path: ucivax!gateway
  2874. From: blumenau@campanile.eecs.berkeley.edu ("Trevor I. Blumenau")
  2875. Subject: Examples wanted
  2876. Message-ID: <9403171808.aa25073@q2.ics.uci.edu>
  2877. Newsgroups: fa.think-c
  2878. X-Message-ID: <199403180208.SAA03784@campanile.eecs.berkeley.edu>
  2879. Approved: usenet@q2.ics.uci.edu
  2880. Lines: 14
  2881. Date: 18 Mar 94 02:08:19 GMT
  2882.  
  2883. I'm testing my translator and I need some example files.  If you could,
  2884. please mail me one or all of the following types (containing any junk):
  2885.  
  2886. AIFF
  2887. AIFC
  2888. PICS
  2889. trak
  2890. sfil
  2891. moov   (Is this different from a MooV?)
  2892.  
  2893. Your help is much appreciated.
  2894.  
  2895. Trevor
  2896. blumenau@eecs.berkeley.edu
  2897. 
  2898. 
  2899. Path: ucivax!gateway
  2900. From: pindar3@cix.compulink.co.uk (Pindar Infotek Ltd)
  2901. Subject: ANSI problems - is this the
  2902. Message-ID: <9403180302.aa24935@q2.ics.uci.edu>
  2903. Newsgroups: fa.think-c
  2904. Reply-To: pindar3@cix.compulink.co.uk
  2905. X-Message-ID: <memo.693501@cix.compulink.co.uk>
  2906. Approved: usenet@q2.ics.uci.edu
  2907. Lines: 29
  2908. Date: 18 Mar 94 11:02:50 GMT
  2909.  
  2910.  
  2911. From Pindar user Ian McCall
  2912.  
  2913. Subject: _ANSI problems - is this the same for MPW?
  2914. Hello.
  2915.  
  2916. I'm new to this newsgroup, so sorry if I'm covering old ground.
  2917.  
  2918. I've just read Mike Crawford's rather worrying message about THINK's
  2919. ANSI library. My question is this - does this affect MPW at all? I
  2920. regularly use both environments, and the symptoms described could
  2921. explain some problems our Technical department have run into using
  2922. calloc and malloc under MPW.
  2923.  
  2924. Finally, is there a F.A.Q. for this group so that I can avoid getting
  2925. flamed to death for asking questions listed there?
  2926.  
  2927. Thanks in advance for any information.
  2928.  
  2929.  
  2930. Cheers,
  2931.       Ian
  2932.  
  2933.  
  2934.  
  2935. ---
  2936. Please make 'Attn:<space>Ian McCall' the first line of your reply
  2937. (not the subject) to ensure automatic forwarding to the correct
  2938. Pindar user.
  2939. 
  2940. 
  2941. Path: ucivax!gateway
  2942. From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
  2943. Subject: RE>Re: memory allocation
  2944. Message-ID: <9403180918.aa07977@q2.ics.uci.edu>
  2945. X-Mailer: InterCon Dispatcher/SMTP for QuickMail
  2946. Newsgroups: fa.think-c
  2947. X-Message-ID: <199403181119244448@macsrv.mgi.com>
  2948. Approved: usenet@q2.ics.uci.edu
  2949. X-Priority: 4
  2950. Lines: 29
  2951. Date: 18 Mar 94 17:18:25 GMT
  2952.  
  2953. Date    3/18/94
  2954. Subject    RE>Re- memory allocation
  2955. From    Brian Bezanson
  2956. To    think-c
  2957.  
  2958.         Reply to:   RE>Re: memory allocation
  2959. >void *malloc( size_t theSize )
  2960. >{
  2961. >    return NewPtr( theSize );
  2962. >}
  2963. >
  2964. >void free( void *thePtr )
  2965. >{
  2966. >    DisposHandle( thePtr );
  2967. >}
  2968.  
  2969. Oops, I think you meant to say DisposPtr not Handle-- A DisposHandle on a
  2970. NewPtr may cash potentially bad things to happen.
  2971.  
  2972. ====
  2973. Brian R Bezanson                      Phone: +1 612 854 1220
  2974. Management Graphics, Inc.             Fax:   +1 612 851 6159
  2975. 1401 E 79th Street                    internet: bezanson@mgi.com
  2976. Minneapolis, MN 55425                 AppleLink: BEZANSON
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982. 
  2983. 
  2984. Path: ucivax!gateway
  2985. From: aland@cs.brandeis.edu ("Alan D.")
  2986. Subject: Re: RE>Re: memory allocation
  2987. Message-ID: <9403181146.aa20872@q2.ics.uci.edu>
  2988. In-Reply-To: <9403180918.aa07977@q2.ics.uci.edu> from "Brian Bezanson" at Mar 18, 94 05:18:25 pm
  2989. X-Mailer: ELM [version 2.4 PL22]
  2990. Content-Transfer-Encoding: 7bit
  2991. Content-Type: text/plain; charset=US-ASCII
  2992. Content-Length: 906
  2993. MIME-Version: 1.0
  2994. Newsgroups: fa.think-c
  2995. X-Message-ID: <199403181946.OAA13549@goose.cs.brandeis.edu>
  2996. Approved: usenet@q2.ics.uci.edu
  2997. Lines: 35
  2998. Date: 18 Mar 94 19:46:10 GMT
  2999.  
  3000. To quote Brian Bezanson,
  3001.  
  3002. > >void *malloc( size_t theSize )
  3003. > >{
  3004. > >    return NewPtr( theSize );
  3005. > >}
  3006.  
  3007. > >void free( void *thePtr )
  3008. > >{
  3009. > >    DisposHandle( thePtr );
  3010. > >}
  3011.  
  3012. > Oops, I think you meant to say DisposPtr not Handle-- A DisposHandle on a
  3013. > NewPtr may cash potentially bad things to happen.
  3014.  
  3015. I was going to reply to this, but I figured I'd wait & see if anyone
  3016. else did...
  3017.  
  3018. I think "free" should have been declared as:
  3019.  
  3020. void free(void *thePtr)
  3021. {
  3022.     DisposePtr(*thePtr);
  3023.     thePtr = NULL;
  3024. }
  3025.  
  3026. This does two things.  First, it corrects what I think is a bug in the
  3027. code (calling DisposHandle on a pointer to a pointer.  They are subtly
  3028. different), and second it sets thePtr to NULL so (assuming you check
  3029. for such things) you can't resuse the pointer 'accidentally'.
  3030.  
  3031. An even better (pun intended) value to set thePtr to is the one which
  3032. "EvenBetterBusError" sets memory location 0 to. :)
  3033.  
  3034.           -=Alan
  3035. 
  3036. 
  3037. Path: ucivax!gateway
  3038. From: evans@natural.com (Christopher Evans)
  3039. Subject: Think Reference Easter Egg
  3040. X-Sender: cevans@cypress
  3041. Message-ID: <9403181208.aa22278@q2.ics.uci.edu>
  3042. Content-Type: text/plain; charset="us-ascii"
  3043. content-length: 734
  3044. Mime-Version: 1.0
  3045. Newsgroups: fa.think-c
  3046. X-Message-ID: <9403182008.AA27596@cypress.sybgate.sybase.com>
  3047. Approved: usenet@q2.ics.uci.edu
  3048. Lines: 20
  3049. Date: 18 Mar 94 20:08:26 GMT
  3050.  
  3051. Since Easter is coming up soon and since I haven't seen this until I was
  3052. looking for the word Rotate in Think Reference, I will share this with you:
  3053.  
  3054. type the following to Think reference, then hit return:
  3055.  
  3056. GetProcessSerialNumberFromPortName Tips
  3057.  
  3058. Make sure you include the space between Name and Tips.
  3059.  
  3060. If this is a WNF, sorry to waste your time.
  3061.  
  3062.  
  3063. <==================================Q==================================>
  3064.   Christopher Evans                |  Internet: evans@natural.com
  3065.   Director, Software Development   |  AOL: ChrisEvans
  3066.   Natural Intelligence, Inc.       |  Sneakernet: 3rd cube on the right
  3067.   2067 Massachusetts Ave.          |  Phone: (617) 876-4876
  3068.   Cambridge, MA 02140              |  Fax: (617) 492-7425
  3069.  
  3070.  
  3071. 
  3072. 
  3073. Path: ucivax!gateway
  3074. From: ccasey@conch.senod.uwf.edu (Christopher Casey)
  3075. Subject: printing part of a PICT
  3076. Message-ID: <9403181458.aa02398@q2.ics.uci.edu>
  3077. Newsgroups: fa.think-c
  3078. X-Message-ID: <9403182258.AA12139@conch.senod.uwf.edu>
  3079. Approved: usenet@q2.ics.uci.edu
  3080. Lines: 30
  3081. Date: 18 Mar 94 22:58:36 GMT
  3082.  
  3083. Hello everybody,
  3084.  
  3085. I seem to have a small problem.
  3086. I have a picture of this size:
  3087.  
  3088. PPPPPPPPPPPPPPPPPPPPPPPPPPP
  3089. P                         P
  3090. P                         P
  3091. PPPPPPPPPPPPPPPPPPPPPPPPPPP
  3092.  
  3093. and a printer of this size:
  3094.  
  3095. xxxx
  3096. x  x
  3097. x  x
  3098. xxxx
  3099.  
  3100. If I scale the picture to fit on the page I can't read the text.
  3101.  
  3102. Does anybody know how to print specific parts of a picture?
  3103.  
  3104. thanx much,
  3105.  
  3106. ccasey@scallop.senod.uwf.edu
  3107. chris casey.
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113. 
  3114. 
  3115. Path: ucivax!gateway
  3116. From: gurgle@netcom.com (Pete Gontier)
  3117. Subject: Re: RE>Re: memory allocation
  3118. Message-ID: <9403181458.aa02439@q2.ics.uci.edu>
  3119. In-Reply-To: <9403181146.aa20872@q2.ics.uci.edu> from "Alan D." at Mar 18, 94 07:46:10 pm
  3120. X-Mailer: ELM [version 2.4 PL23]
  3121. Content-Transfer-Encoding: 7bit
  3122. Content-Type: text/plain; charset=US-ASCII
  3123. Content-Length: 894
  3124. MIME-Version: 1.0
  3125. Newsgroups: fa.think-c
  3126. X-Message-ID: <199403182259.OAA16605@netcom9.netcom.com>
  3127. Approved: usenet@q2.ics.uci.edu
  3128. Lines: 34
  3129. Date: 18 Mar 94 22:58:49 GMT
  3130.  
  3131. > I think "free" should have been declared as:
  3132. >
  3133. > void free(void *thePtr)
  3134. > {
  3135. >     DisposePtr(*thePtr);
  3136. >     thePtr = NULL;
  3137. > }
  3138. >
  3139. > ...it sets thePtr to NULL so (assuming you check
  3140. > for such things) you can't resuse the pointer 'accidentally'.
  3141.  
  3142. You certainly can still use the pointer accidentally. If I write
  3143.  
  3144. void foo (char *s)
  3145. {
  3146.     free (s);
  3147. }
  3148.  
  3149. ...'s' still has the value passed into 'foo' because it gets passed to
  3150. 'free' by value, not by reference. The line:
  3151.  
  3152. >       thePtr = NULL;
  3153.  
  3154. ...has basically no effect from the perspective of 'foo'.
  3155.  
  3156. > An even better (pun intended) value to set thePtr to is the one which
  3157. > "EvenBetterBusError" sets memory location 0 to. :)
  3158.  
  3159. That is a value tailored specifically to location 0. It may not be the
  3160. best value for pointers. Then again, it may. I use -1 because it's easy
  3161. to remember.
  3162.  
  3163. --
  3164.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  3165. 
  3166. 
  3167. Path: ucivax!gateway
  3168. From: pchang@cs.stanford.edu (The Weasel)
  3169. Subject: Re: RE>Re: memory allocation
  3170. Message-ID: <9403181726.aa10641@q2.ics.uci.edu>
  3171. In-Reply-To: <9403181146.aa20872@q2.ics.uci.edu> from "Alan D." at Mar 18, 94 07:46:10 pm
  3172. X-Mailer: ELM [version 2.4 PL21]
  3173. Content-Type: text
  3174. Content-Length: 579
  3175. Newsgroups: fa.think-c
  3176. X-Message-ID: <9403190125.AA19859@Xenon.Stanford.EDU>
  3177. Approved: usenet@q2.ics.uci.edu
  3178. Lines: 23
  3179. Date: 19 Mar 94 01:26:04 GMT
  3180.  
  3181. You write :
  3182. > I think "free" should have been declared as:
  3183. >
  3184. > void free(void *thePtr)
  3185. > {
  3186. >         DisposePtr(*thePtr);
  3187. >         thePtr = NULL;
  3188. > }
  3189.  
  3190. This does not set the pointer that you pass in to NULL since the address
  3191. is still passed by value. For example:
  3192.  
  3193.     char* binky = (char*)malloc(sizeof(char));
  3194.  
  3195.     free(binky);
  3196.  
  3197. After the free call finishes binky will still have the same value that it
  3198. did before the free call, but now it will be pointing to unallocated space.
  3199.  
  3200. Peter
  3201. --
  3202.      "The road of excess leads to the palace of wisdom."
  3203.                                William Blake
  3204. 
  3205. 
  3206. Path: ucivax!gateway
  3207. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  3208. Subject: Re: RE>Re: memory allocation
  3209. X-Sender: resnick@tarski.cogsci.uiuc.edu
  3210. Message-ID: <9403181736.aa11075@q2.ics.uci.edu>
  3211. Content-Type: text/plain; charset="us-ascii"
  3212. Mime-Version: 1.0
  3213. Newsgroups: fa.think-c
  3214. X-Message-ID: <a9b0068900021003468d@[128.174.107.17]>
  3215. Approved: usenet@q2.ics.uci.edu
  3216. Lines: 38
  3217. Date: 19 Mar 94 01:36:33 GMT
  3218.  
  3219. At  7:46 PM 3/18/94 +0000, Alan D. wrote:
  3220. >I think "free" should have been declared as:
  3221. >
  3222. >void free(void *thePtr)
  3223. >{
  3224. >        DisposePtr(*thePtr);
  3225. >        thePtr = NULL;
  3226. >}
  3227.  
  3228. Not quite. If you really want to do this, you would have to:
  3229.  
  3230. void free(void **thePtr)
  3231. {
  3232.         DisposePtr(*thePtr);
  3233.         *thePtr = NULL;
  3234. }
  3235.  
  3236. Otherwise, you are setting the local variable "thePtr" to NULL, which is
  3237. not going to do a thing as far as reusing the pointer goes. What *you* want
  3238. to do is set the contents of the variable that contains the pointer to
  3239. NULL; in order to do that, you have to pass by reference.
  3240.  
  3241. But I would not recommend doing this anyway. Just because you set the
  3242. contents of one variable that contains this pointer to NULL, it doesn't
  3243. mean that you haven't copied that value to other variables, and all of
  3244. those would be invalid anyway.
  3245.  
  3246. Just write safe code.
  3247.  
  3248. pr
  3249.  
  3250. --
  3251. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  3252. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  3253. System manager - Cognitive Science Group, Beckman Institute, UIUC
  3254. Internet: resnick@cogsci.uiuc.edu
  3255.  
  3256.  
  3257. 
  3258. 
  3259. Path: ucivax!gateway
  3260. From: jonzy@cc.utah.edu (Rhett 'Jonzy' Jones)
  3261. Subject: RE: RE>Re: memory allocation
  3262. Message-ID: <9403191551.aa03797@q2.ics.uci.edu>
  3263. In-Reply-To: <9403181736.aa11075@q2.ics.uci.edu>
  3264. Content-Type: TEXT/PLAIN; charset=US-ASCII
  3265. MIME-Version: 1.0
  3266. Newsgroups: fa.think-c
  3267. X-Message-ID: <Pine.3.87.9403191635.B26768-0100000@soar.cc.utah.edu>
  3268. Approved: usenet@q2.ics.uci.edu
  3269. Lines: 34
  3270. Date: 19 Mar 94 23:51:16 GMT
  3271.  
  3272. Someone writes:
  3273.  
  3274. >I think "free" should have been declared as:
  3275. >
  3276. >void free(void *thePtr)
  3277. >{
  3278. >        DisposePtr(*thePtr);
  3279. >        thePtr = NULL;
  3280. >}
  3281.  
  3282. Someone else writes:
  3283.  
  3284. > void free(void **thePtr)
  3285. > {
  3286. >         DisposePtr(*thePtr);
  3287. >         *thePtr = NULL;
  3288. > }
  3289.  
  3290.   Since when does the standard state free() makes any assignments?
  3291.   If your modified free() routine ends up buried behind the sceens
  3292.   in some library, debugging could be a pain in the hiney.
  3293.  
  3294.   What is wrong with:
  3295.     (void)free(thePtr);
  3296.     thePtr = (PointerCast)NULL;
  3297.  
  3298.   Just food for thought.
  3299. ----------------------------------------------------------------
  3300. Rhett 'Jonzy' Jones                       | jonzy@cc.utah.edu
  3301. goPHerMaster                              | JONZY@UTAHCCA.BITNET
  3302. Gopher, PH, postmaster, ...               | (801) 581-8810
  3303. ----------------------------------------------------------------
  3304.  
  3305.  
  3306. 
  3307. 
  3308. Path: ucivax!gateway
  3309. From: stevenj@golf.sps.mot.com (Steven Jin)
  3310. Subject: Symantec C++ book
  3311. Message-ID: <9403211201.aa26839@q2.ics.uci.edu>
  3312. Newsgroups: fa.think-c
  3313. X-Message-ID: <9403211958.AA00835@golf.sps.mot.com>
  3314. Approved: usenet@q2.ics.uci.edu
  3315. Lines: 10
  3316. Date: 21 Mar 94 20:01:44 GMT
  3317.  
  3318.  
  3319.  
  3320. Has anyone read "Symantec C++ Macintosh programming guide"
  3321. by Symantec? Can you tell me how you liked the book?
  3322. I am thinking about buying the book but I like to get some
  3323. opinions from others first. Book costs about $40 I think.
  3324.  
  3325. Thank you,
  3326. Steven
  3327.  
  3328. 
  3329. 
  3330. Path: ucivax!gateway
  3331. From: harmonw@aol.com
  3332. Subject: The Internet and tcl archives
  3333. Message-ID: <9403211623.aa15352@q2.ics.uci.edu>
  3334. X-Mailer: America Online Mailer
  3335. Newsgroups: fa.think-c
  3336. X-Message-ID: <9403211921.tn204026@aol.com>
  3337. Approved: usenet@q2.ics.uci.edu
  3338. Lines: 8
  3339. Date: 22 Mar 94 00:23:35 GMT
  3340.  
  3341. What is happening on the internet with respect to Think C files?  The ftp
  3342. sites mac.archive.umich.edu and wuarchive.wustl.edu no longer accept
  3343. anonymous ftp.  They both stopped during this last month (Feb-Mar 1994).  The
  3344. sumex info-mac at Stanford has been impossible to get into.  Is Info-mac
  3345. archives dying???
  3346.  
  3347. I heard rumors of an info-mac CD-ROM coming out.  Is this true?  If so where
  3348. can it be ordered?
  3349. 
  3350. 
  3351. Path: ucivax!gateway
  3352. From: ASDVORAK@ccit.arizona.edu
  3353. Subject: SFGetFile()
  3354. Message-ID: <9403211723.aa19435@q2.ics.uci.edu>
  3355. Content-transfer-encoding: 7BIT
  3356. MIME-version: 1.0
  3357. Newsgroups: fa.think-c
  3358. X-Message-ID: <01HA8RUP1EQQ8WWUNH@CCIT.ARIZONA.EDU>
  3359. Approved: usenet@q2.ics.uci.edu
  3360. X-VMS-To: IN%"think-c@ics.uci.edu"
  3361. Lines: 37
  3362. Date: 22 Mar 94 01:23:15 GMT
  3363. X-Envelope-to: think-c@ics.uci.edu
  3364.  
  3365.     I am have trouble using the procedure SFGetFile().  Whenever I run the
  3366. following code under the Think C Debugger it works fine, but when I try to run
  3367. it without the debugger my program quits without bringing up the Get File
  3368. dialog box.  I took this fragment out of Think Ref so I assumed it would work.
  3369. Could someone please tell me what's going wrong?  Thanks in advance (I'm
  3370. working on a IIci with Think C 6.01).  Here's the code:
  3371.  
  3372. #include <Files.h>
  3373. #include <StandardFile.h>
  3374.  
  3375. main()
  3376. {
  3377.     SFReply    tr;
  3378.     short    rc, fRefNum;
  3379.     Point    where;
  3380.  
  3381.     where.h=100; where.v=50;/* where the Standard File dialog window goes
  3382. */
  3383.  
  3384.     SFGetFile( where, "\pSelect a File", 0, -1, 0, 0, &tr );
  3385.  
  3386.     if ( tr.good )
  3387.     {
  3388.         rc = FSOpen( tr.fName, tr.vRefNum, &fRefNum );
  3389.         if ( rc )
  3390.         {
  3391.             SysBeep(20);
  3392.             return;
  3393.         }
  3394.         FSClose( fRefNum );
  3395.     }
  3396. }
  3397.  
  3398. Alexander
  3399.  
  3400. email:  asdvorak@ccit.arizona.edu
  3401.  
  3402. 
  3403. 
  3404. Path: ucivax!gateway
  3405. From: monty@roscom.com (Monty Solomon)
  3406. Subject: Re: The Internet and tcl archives
  3407. Message-ID: <9403211748.aa20939@q2.ics.uci.edu>
  3408. Newsgroups: fa.think-c
  3409. X-Message-ID: <199403220126.AA21607@roscom.COM>
  3410. Approved: usenet@q2.ics.uci.edu
  3411. Lines: 16
  3412. Date: 22 Mar 94 01:48:04 GMT
  3413.  
  3414. > I heard rumors of an info-mac CD-ROM coming out.  Is this true?  If so where
  3415. > can it be ordered?
  3416.  
  3417. Info-Mac CD-ROM
  3418. Info-Mac II CD-ROM
  3419. Info-Mac III CD-ROM
  3420. $49.95 + $5 s/h
  3421.  
  3422. Pacific HiTech, Inc.
  3423. 4530 Fortuna Way
  3424. Salt Lake City, UT  84124
  3425. 801 278 2042
  3426. Fax 801 278 2666
  3427. Orders 800 765 8369
  3428. 71175.3152@CompuServe.COM
  3429.  
  3430. 
  3431. 
  3432. Path: ucivax!gateway
  3433. From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
  3434. Subject: Re: The Internet and tcl archives
  3435. Message-ID: <9403220607.aa03015@q2.ics.uci.edu>
  3436. In-Reply-To: <9403211623.aa15352@q2.ics.uci.edu>; from "harmonw@aol.com" at Mar 22, 94 12:23 am
  3437. X-Mailer: ELM [version 2.3 PL2]
  3438. Newsgroups: fa.think-c
  3439. X-Message-ID: <9403221407.AA07007@mozart.aero.ufl.edu>
  3440. Approved: usenet@q2.ics.uci.edu
  3441. Lines: 12
  3442. Date: 22 Mar 94 14:07:36 GMT
  3443.  
  3444. >
  3445. > What is happening on the internet with respect to Think C files?  The ftp
  3446. > sites mac.archive.umich.edu and wuarchive.wustl.edu no longer accept
  3447. > anonymous ftp.  They both stopped during this last month (Feb-Mar 1994).  The
  3448. > sumex info-mac at Stanford has been impossible to get into.  Is Info-mac
  3449. > archives dying???
  3450. >
  3451.     Wuarchive is alive, but not as well as it used to.  You can still
  3452. ftp to it, but the maximum number of people that can ftp at a given time
  3453. has been reduced.  About archive.umich.edu, I can't say much about it since
  3454. I haven't visited it for quite a long time.
  3455.  
  3456. 
  3457. 
  3458. Path: ucivax!gateway
  3459. From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
  3460. Subject: RE>SFGetFile()
  3461. Message-ID: <9403220755.aa07783@q2.ics.uci.edu>
  3462. X-Mailer: InterCon Dispatcher/SMTP for QuickMail
  3463. Newsgroups: fa.think-c
  3464. X-Message-ID: <199403220956039689@macsrv.mgi.com>
  3465. Approved: usenet@q2.ics.uci.edu
  3466. X-Priority: 4
  3467. Lines: 70
  3468. Date: 22 Mar 94 15:55:14 GMT
  3469.  
  3470. Date    3/22/94
  3471. Subject    RE>SFGetFile()
  3472. From    Brian Bezanson
  3473. To    ASDVORAK, think-c
  3474.  
  3475.         Reply to:   RE>SFGetFile()
  3476. >    I am have trouble using the procedure SFGetFile().  Whenever I run the
  3477. >following code under the Think C Debugger it works fine, but when I try to
  3478. run
  3479. >it without the debugger my program quits without bringing up the Get File
  3480. >dialog box.  I took this fragment out of Think Ref so I assumed it would work.
  3481.  
  3482. >Could someone please tell me what's going wrong?  Thanks in advance (I'm
  3483. >working on a IIci with Think C 6.01).  Here's the code:
  3484. >
  3485. >#include <Files.h>
  3486. >#include <StandardFile.h>
  3487. >
  3488. >main()
  3489. >{
  3490. >    SFReply    tr;
  3491. >    short    rc, fRefNum;
  3492. >    Point    where;
  3493. >
  3494. >    where.h=100; where.v=50;/* where the Standard File dialog window goes
  3495. >*/
  3496. >
  3497. >    SFGetFile( where, "\pSelect a File", 0, -1, 0, 0, &tr );
  3498.  
  3499. .. no more needed ..
  3500.  
  3501. You need to initialize the Mac toolbox managers. You got lucky in the Debugger
  3502. because it had initialized the Mac environment, when created as a real
  3503. application you're on your own.
  3504.  
  3505. Do something like this (taken from the THINK example bullseye.c)
  3506.  
  3507. /****
  3508.  * InitMacintosh()
  3509.  *
  3510.  * Initialize all the managers & memory
  3511.  *
  3512.  ****/
  3513.  
  3514. void InitMacintosh(void)
  3515.  
  3516. {
  3517.     MaxApplZone();
  3518.  
  3519.     InitGraf(&thePort);
  3520.     InitFonts();
  3521.     FlushEvents(everyEvent, 0);
  3522.     InitWindows();
  3523.     InitMenus();
  3524.     TEInit();
  3525.     InitDialogs(0L);
  3526.     InitCursor();
  3527.  
  3528. }
  3529.  
  3530. ====
  3531. Brian R Bezanson                      Phone: +1 612 854 1220
  3532. Management Graphics, Inc.             Fax:   +1 612 851 6159
  3533. 1401 E 79th Street                    internet: bezanson@mgi.com
  3534. Minneapolis, MN 55425                 AppleLink: BEZANSON
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540. 
  3541. 
  3542. Path: ucivax!gateway
  3543. From: reardon@maroon.tc.umn.edu (Rich Reardon)
  3544. Subject: Disk drive code
  3545. Message-ID: <9403221105.aa19230@q2.ics.uci.edu>
  3546. Newsgroups: fa.think-c
  3547. Reply-To: Rich Reardon <reardon@maroon.tc.umn.edu>
  3548. X-Message-ID: <9403221105.aa19230@q2.ics.uci.edu>
  3549. Approved: usenet@q2.ics.uci.edu
  3550. Lines: 18
  3551. Date: 22 Mar 94 19:05:29 GMT
  3552.  
  3553. I am a novice C, and Think C, programmer. I would like to write an xcmd for
  3554. Hypercard that polls a Mac's floppy drive, and if it finds a Mac disk, returns
  3555. the volume name of the floppy.
  3556. Could someone point me to code that may exist, or to the toolbox calls I would
  3557. need to write the code? (I know how to create the xcmd part once I have the
  3558. code).
  3559. Thanks.
  3560.  
  3561. Rich Reardon
  3562. University Media Resources
  3563. 540 Rarig Center
  3564. 330 21st Ave South
  3565. Minneapolis, MN 55455
  3566.  
  3567. 612-625-3486
  3568. fax: 612-624-6079
  3569. reardon@maroon.tc.umn.edu
  3570.  
  3571. 
  3572. 
  3573. Path: ucivax!gateway
  3574. From: rpa@netcom.com (Ramin Firoozye)
  3575. Subject: Re:Info-Mac CD-ROM
  3576. Message-ID: <9403221222.aa25004@q2.ics.uci.edu>
  3577. In-Reply-To: <9403211623.aa15352@q2.ics.uci.edu> from "harmonw@aol.com" at Mar 22, 94 00:23:35 am
  3578. X-Mailer: ELM [version 2.4 PL23]
  3579. Content-Transfer-Encoding: 7bit
  3580. Content-Type: text/plain; charset=US-ASCII
  3581. Content-Length: 396
  3582. MIME-Version: 1.0
  3583. Newsgroups: fa.think-c
  3584. X-Message-ID: <199403222023.MAA24975@mail.netcom.com>
  3585. Approved: usenet@q2.ics.uci.edu
  3586. Lines: 14
  3587. Date: 22 Mar 94 20:22:55 GMT
  3588.  
  3589. >
  3590. > I heard rumors of an info-mac CD-ROM coming out.  Is this true?  If so where
  3591. > can it be ordered?
  3592. >
  3593. I was under the impression there already was one out there. Have you tried
  3594. Walnut Creek CD-ROM at (800) 786-9907. I though I saw one advertised by
  3595. someone (possibly them) at Comdex.
  3596.  
  3597. R.
  3598. --
  3599. Ramin Firoozye'
  3600. rp&A Inc. - San Francisco, California
  3601. Internet: rpa@netcom.COM - CIS: 70751,252
  3602. --
  3603. 
  3604. 
  3605. Path: ucivax!gateway
  3606. From: ccasey@conch.senod.uwf.edu (Christopher Casey)
  3607. Subject: saving pictures
  3608. Message-ID: <9403221429.aa03282@q2.ics.uci.edu>
  3609. Newsgroups: fa.think-c
  3610. X-Message-ID: <9403222228.AA19500@conch.senod.uwf.edu>
  3611. Approved: usenet@q2.ics.uci.edu
  3612. Lines: 10
  3613. Date: 22 Mar 94 22:29:25 GMT
  3614.  
  3615. Hello again,
  3616.  
  3617. I know I've asked this before, but does anyone know any good books that have code demonstrating how to save a picture?
  3618.  
  3619. I can't seem to figure it out from Inside Mac.
  3620.  
  3621. thanx,
  3622. chris casey
  3623.  
  3624. ccasey@triton.senod.uwf.edu
  3625. 
  3626. 
  3627. Path: ucivax!gateway
  3628. From: gurgle@netcom.com (Pete Gontier)
  3629. Subject: Re: saving pictures
  3630. Message-ID: <9403222137.aa25199@q2.ics.uci.edu>
  3631. In-Reply-To: <9403221429.aa03282@q2.ics.uci.edu> from "Christopher Casey" at Mar 22, 94 10:29:25 pm
  3632. X-Mailer: ELM [version 2.4 PL23]
  3633. Content-Transfer-Encoding: 7bit
  3634. Content-Type: text/plain; charset=US-ASCII
  3635. Content-Length: 1342
  3636. MIME-Version: 1.0
  3637. Newsgroups: fa.think-c
  3638. X-Message-ID: <199403230537.VAA06144@netcom9.netcom.com>
  3639. Approved: usenet@q2.ics.uci.edu
  3640. Lines: 28
  3641. Date: 23 Mar 94 05:37:09 GMT
  3642.  
  3643. > ...does anyone know any good books that have code demonstrating how to
  3644. > save a picture? I can't seem to figure it out from Inside Mac.
  3645.  
  3646. Inside Mac won't help you at all. It used to be that there were Apple
  3647. Developer Technical Support Notes describing some of the simple graphics
  3648. file formats (MacPaint, PICT), but as those formats got spun off along
  3649. with the products which read and wrote them, Apple withdrew the Tech
  3650. Notes and replaced them with pointers to asking the relevant companies.
  3651. I'm not sure if Claris even ships a MacPaint or MacDraw any more --
  3652. anybody know?
  3653.  
  3654. Anyway, you have two ways to go:
  3655.  
  3656.    (1) Do your drawing into a PicHandle and save it as a PICT resource.
  3657.        AddResource, WriteResource, end of story.
  3658.  
  3659.    (2) Do your drawing whatever way you want and dig up the relevant
  3660.        documentation from the relevant vendor. Some people on this
  3661.        list might even be able to provide a description of some of
  3662.        the simpler file formats in just a few lines of text. For
  3663.        example (this may or may not be valid -- my memory is fuzzy):
  3664.  
  3665.        for PICT, write 512 bytes of 0, then write out a PicHandle.
  3666.        The first 512 bytes used to be meaningful, but nobody pays
  3667.        attention any more, and programs that care will be happy with 0.
  3668.  
  3669. --
  3670.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  3671. 
  3672. 
  3673. Path: ucivax!gateway
  3674. From: inei@dcs.gla.ac.uk (inei)
  3675. Subject: Where can I get MetroWerks CodeWarrior
  3676. Message-ID: <9403230525.aa26121@q2.ics.uci.edu>
  3677. Newsgroups: fa.think-c
  3678. X-Message-ID: <9403231325.AA17720@hawaii.dcs.gla.ac.uk>
  3679. Approved: usenet@q2.ics.uci.edu
  3680. Lines: 14
  3681. Date: 23 Mar 94 13:25:46 GMT
  3682.  
  3683.  
  3684. Does anyone know where I can get a native compiler for the Power Mac
  3685. called MetroWerks CodeWarrior?  A name, telephone number and address
  3686. would be greatly appreciated.
  3687.  
  3688. I've been told it may be available from APDA.  Can anyone send me
  3689. details of how I can get it from APDA?
  3690.  
  3691. Many thanks in advance.
  3692.  
  3693. Mail:  Nick Nei, Computing Science Dept.,
  3694.        Glasgow Univ., 17 Lilybank Gardens,
  3695.        Glasgow G12 8QQ, UK.  Tel: (041) 339 8855 x 5457
  3696. ARPA:  inei%uk.ac.glasgow.dcs@nsfnet-relay.ac.uk USENET: inei@cs.glasgow.uucp
  3697. 
  3698. 
  3699. Path: ucivax!gateway
  3700. From: lukas@iso.wwz.unibas.ch
  3701. Subject: Re: Where can I get MetroWerks CodeWarrior
  3702. Message-ID: <9403230849.aa04663@q2.ics.uci.edu>
  3703. In-Reply-To: Your message of "23 Mar 94 13:25:46 GMT." <9403230525.aa26121@q2.ics.uci.edu>
  3704. Newsgroups: fa.think-c
  3705. X-Message-ID: <9403231648.AA08213@iso.wwz.unibas.ch>
  3706. Approved: usenet@q2.ics.uci.edu
  3707. Lines: 19
  3708. X-Mts: smtp
  3709. Date: 23 Mar 94 16:49:04 GMT
  3710.  
  3711. You can get informations from MetroWerks with the following addresses
  3712.  
  3713. MetroWerks Inc.
  3714. The Trimex Building, Route 11
  3715. Mooers, NY 12958, USA
  3716.  
  3717. Tel. (514) 747-5999
  3718.  
  3719. Fax. (514) 747-2822
  3720.  
  3721. applelink d2734
  3722.  
  3723. internet metro@info.uqam.ca
  3724.  
  3725.  
  3726.  
  3727. If you buy the CodeWarrior and you think that this might be an alternative, especially the class library, to use on the mac please send me an e-mail
  3728.  
  3729.  
  3730. 
  3731. 
  3732. Path: ucivax!gateway
  3733. From: andyb+@cmu.edu ("Andrew J. Breen")
  3734. Subject: Timing Functions
  3735. Message-ID: <9403231236.aa18202@q2.ics.uci.edu>
  3736. Newsgroups: fa.think-c
  3737. X-Message-ID: <MhY_PMG00iV407Smh9@andrew.cmu.edu>
  3738. Approved: usenet@q2.ics.uci.edu
  3739. Lines: 11
  3740. Date: 23 Mar 94 20:36:40 GMT
  3741.  
  3742. I need some help in implementing some timing functions.  I need to time
  3743. the length of insertion into an array.  I have been trying to use the
  3744. time.h stuff, and saving the time into a variable before the array, and
  3745. after.  I am just getting, what seems like, erroneous values into these
  3746. variables.  I have been trying to use time_t.  Any hints as to how to
  3747. implement using time.h, interpreting the return values, or another
  3748. timing method.
  3749.  
  3750. Andy
  3751.  
  3752. The graduation countdown has begun.
  3753. 
  3754. 
  3755. Path: ucivax!gateway
  3756. From: abarne1@gl.umbc.edu (barnett aaron)
  3757. Subject: terminal emulation
  3758. Message-ID: <9403231250.aa19022@q2.ics.uci.edu>
  3759. Newsgroups: fa.think-c
  3760. X-Message-ID: <199403232049.PAA10164@umbc9.umbc.edu>
  3761. Approved: usenet@q2.ics.uci.edu
  3762. Lines: 6
  3763. Date: 23 Mar 94 20:50:04 GMT
  3764.  
  3765. where can i get info on escape sequences for vt100/200...
  3766. specifically does anyone know the sequences for programming function keys?
  3767.  
  3768. .
  3769. aaron <abarne1@gl.umbc.edu>
  3770. "It's a safety mechanism, the mind shuts off."
  3771. 
  3772. 
  3773. Path: ucivax!gateway
  3774. From: ASDVORAK@ccit.arizona.edu
  3775. Subject: Another question...
  3776. Message-ID: <9403231837.aa13095@q2.ics.uci.edu>
  3777. Content-transfer-encoding: 7BIT
  3778. MIME-version: 1.0
  3779. Newsgroups: fa.think-c
  3780. X-Message-ID: <01HABMZG5PWY8WXYTO@CCIT.ARIZONA.EDU>
  3781. Approved: usenet@q2.ics.uci.edu
  3782. X-VMS-To: IN%"think-c@ics.UCI.EDU"
  3783. Lines: 21
  3784. Date: 24 Mar 94 02:37:45 GMT
  3785. X-Envelope-to: think-c@ics.UCI.EDU
  3786.  
  3787.     Thank you for all your replies to SFGetFile().  Sorry for asking what
  3788. turned out to be a silly question.  The function SFGetFile() in my code sample
  3789. didn't work because I somehow overlooked puting in my InitToolBox() procedure.
  3790. By putting it in, my code works fine.
  3791.     Here's another question:
  3792.     Many of the ToolBox routines accept pointers to data structures.  For
  3793. example, SetRect takes a pointer to a Rect, NewWindow takes a pointer to a Rect
  3794. as well as a pointer to a long (RefCon), etc.  It seems to me that this allows
  3795. these procedures (or functions), in effect, to return more variables then would
  3796. normally be allowed while avoiding the use of global variables.  What exactly
  3797. goes on when SetRect modifies the data structure assigned to r in:
  3798. SetRect(&r,10,10,100,100)?  Can I use this technique in functions that I
  3799. design?  I often would like to return several different variables from a
  3800. function and would like to avoid the mess of creating a data structure to hold
  3801. them all and returning a pointer to such a data structure.  Thank you in
  3802. advance for your help.
  3803.  
  3804. Alexander Dvorak
  3805.  
  3806. email:  asdvorak@ccit.arizona.edu
  3807.  
  3808. 
  3809. 
  3810. Path: ucivax!gateway
  3811. From: askwersk@mit.edu
  3812. Subject: TCL Archives
  3813. Message-ID: <9403232001.aa16170@q2.ics.uci.edu>
  3814. Newsgroups: fa.think-c
  3815. X-Message-ID: <9403240401.AA20711@al-forno.MIT.EDU>
  3816. Approved: usenet@q2.ics.uci.edu
  3817. Lines: 5
  3818. Date: 24 Mar 94 04:01:40 GMT
  3819.  
  3820.  
  3821. To those who were looking for the TCL-TALK archives, they have been
  3822. moved to daemon.ncsa.edu.  FTP there to find them in the TCL directory.
  3823.  
  3824. Adam Skwersky
  3825. 
  3826. 
  3827. Path: ucivax!gateway
  3828. From: askwersk@mit.edu
  3829. Subject: TCL TALK Archives.
  3830. Message-ID: <9403232007.aa16415@q2.ics.uci.edu>
  3831. Newsgroups: fa.think-c
  3832. X-Message-ID: <9403240407.AA20796@al-forno.MIT.EDU>
  3833. Approved: usenet@q2.ics.uci.edu
  3834. Lines: 10
  3835. Date: 24 Mar 94 04:07:26 GMT
  3836.  
  3837.  
  3838. IN my last message I said the TCL-TALK archive was moved to daemon.ncsa.edu.
  3839.  
  3840.  
  3841. MY MISTAKE! It was really moved to daemon.ncsa.uiuc.edu.
  3842.  
  3843.  
  3844. Sorry,
  3845.  
  3846. Adam Skwersky
  3847. 
  3848. 
  3849. Path: ucivax!gateway
  3850. From: roderis@csos.orst.edu ("Stephen C. Roderick")
  3851. Subject: Re: Timing Functions
  3852. Message-ID: <9403232044.aa17733@q2.ics.uci.edu>
  3853. In-Reply-To: <9403231236.aa18202@q2.ics.uci.edu>
  3854. Content-Type: TEXT/PLAIN; charset=US-ASCII
  3855. MIME-Version: 1.0
  3856. Newsgroups: fa.think-c
  3857. X-Message-ID: <Pine.3.88.9403232015.A22732-0100000@CSOS.ORST.EDU>
  3858. Approved: usenet@q2.ics.uci.edu
  3859. Lines: 41
  3860. Date: 24 Mar 94 04:44:51 GMT
  3861.  
  3862. On 23 Mar 1994, Andrew J. Breen wrote:
  3863.  
  3864. > I need some help in implementing some timing functions.  I need to time
  3865. > the length of insertion into an array.  I have been trying to use the
  3866. > time.h stuff, and saving the time into a variable before the array, and
  3867. > after.  I am just getting, what seems like, erroneous values into these
  3868. > variables.  I have been trying to use time_t.  Any hints as to how to
  3869. > implement using time.h, interpreting the return values, or another
  3870. > timing method.
  3871. >
  3872. > Andy
  3873. >
  3874. > The graduation countdown has begun.
  3875. >
  3876.  
  3877. #include <time.h>
  3878.  
  3879. void TimeThis(void)
  3880. {
  3881. clock_t codeTime;
  3882.  
  3883.   codeTime = clock();
  3884.  
  3885.   // code that you are timing goes here
  3886.  
  3887.   codeTime = clock() - codeTime;
  3888.  
  3889.   printf("Total time taken = %d ticks (%d seconds)\n", codeTime,
  3890.          codeTime/CLOCKS_PER_SEC);
  3891.  
  3892. }
  3893.  
  3894. Hasta,
  3895.  
  3896. Steve
  3897.  
  3898. -----------------------------------------------------------
  3899. Stephen Roderick
  3900. roderis@kira.csos.orst.edu
  3901. -----------------------------------------------------------
  3902.  
  3903. 
  3904. 
  3905. Path: ucivax!gateway
  3906. From: JeffC@cc.snow.edu ("Jeffrey K. Carney")
  3907. Subject: Launching from Doc
  3908. Message-ID: <9403251247.aa09611@q2.ics.uci.edu>
  3909. Content-Type: text/plain; charset="us-ascii"
  3910. Mime-Version: 1.0
  3911. Newsgroups: fa.think-c
  3912. X-Message-ID: <9403251246.aa09611@q2.ics.uci.edu>
  3913. Approved: usenet@q2.ics.uci.edu
  3914. Lines: 27
  3915. Date: 25 Mar 94 20:47:07 GMT
  3916.  
  3917. If someone would be so kind:
  3918.  
  3919. I want to simulate what happens when you double-click on a document to open
  3920. an application.  That is, from inside my app, given a filespec to a
  3921. document (actually a settings file) and one to a daughter application, I
  3922. want to launch the daughter application using the settings described in the
  3923. document.  My guess is that I do it this way:
  3924.  
  3925. Launch the app
  3926. send the app an OpenDocument apple event
  3927. the apple event names the document
  3928.  
  3929. Am I on target?
  3930. In any case, could some kind soul flesh this out in a little more detail?
  3931. I have no significant experience with apple events so far, and would
  3932. appreciate a little babying.
  3933.  
  3934. TIA
  3935.  
  3936. +===================+=================================+===================+
  3937. |    Jeff Carney    |                                 |   Snow  College   |
  3938. | jeffc@cc.snow.edu |                                 | Ephraim, UT 84627 |
  3939. |-------------------+---------------------------------+-------------------|
  3940. |Plato:  "Everything that deceives appears to cast a spell upon the mind."|
  3941. +=========================================================================+
  3942.  
  3943.  
  3944. 
  3945. 
  3946. Path: ucivax!gateway
  3947. From: evans@natural.com (Christopher Evans)
  3948. Subject: Re: Launching from Doc
  3949. X-Sender: cevans@cypress
  3950. Message-ID: <9403280547.aa24019@q2.ics.uci.edu>
  3951. Content-Type: text/plain; charset="us-ascii"
  3952. content-length: 1234
  3953. Mime-Version: 1.0
  3954. Newsgroups: fa.think-c
  3955. X-Message-ID: <9403281347.AB01836@cypress.sybgate.sybase.com>
  3956. Approved: usenet@q2.ics.uci.edu
  3957. Lines: 30
  3958. Date: 28 Mar 94 13:47:36 GMT
  3959.  
  3960. >If someone would be so kind:
  3961. >
  3962. >I want to simulate what happens when you double-click on a document to open
  3963. >an application.  That is, from inside my app, given a filespec to a
  3964. >document (actually a settings file) and one to a daughter application, I
  3965. >want to launch the daughter application using the settings described in the
  3966. >document.  My guess is that I do it this way:
  3967. >
  3968. >Launch the app
  3969. >send the app an OpenDocument apple event
  3970. >the apple event names the document
  3971. >
  3972. >Am I on target?
  3973. >In any case, could some kind soul flesh this out in a little more detail?
  3974. >I have no significant experience with apple events so far, and would
  3975. >appreciate a little babying.
  3976.  
  3977. Close but doing this will result in both a oapp and odoc event being sent
  3978. to the application.  Check out the LaunchApplication routine.  It lets you
  3979. send a list of aliases to open.
  3980.  
  3981.  
  3982. <==================================Q==================================>
  3983.   Christopher Evans                |  Internet: evans@natural.com
  3984.   Director, Software Development   |  AOL: ChrisEvans
  3985.   Natural Intelligence, Inc.       |  Sneakernet: 3rd cube on the right
  3986.   2067 Massachusetts Ave.          |  Phone: (617) 876-4876
  3987.   Cambridge, MA 02140              |  Fax: (617) 492-7425
  3988.  
  3989.  
  3990. 
  3991. 
  3992. Path: ucivax!gateway
  3993. From: jaha@secrc.abb.se ("Jan R. M. Rohman")
  3994. Subject: Strange Error
  3995. Message-ID: <9403282343.aa11136@q2.ics.uci.edu>
  3996. Newsgroups: fa.think-c
  3997. X-Message-ID: <9403290650.AA11840@kbmhp1.secrc.abb.se>
  3998. Reply-To: jaha@secrc.abb.se
  3999. Approved: usenet@q2.ics.uci.edu
  4000. Lines: 27
  4001. Date: 29 Mar 94 07:43:06 GMT
  4002.  
  4003.  
  4004. I'm developing a program in Think C 5.0.4 on an LC-475 and the
  4005. application seems to run perfectly. But, when I run the application,
  4006. both the builded and through the compiler with the debugger on, it
  4007. craches on a Mac IIx at the line:
  4008.  
  4009. menuBar = GetNewMBar(rMenuBar);
  4010.  
  4011. The error message says: bad address. When I singlestep the code in
  4012. the debugger I have to restart the Mac IIx after entering the line
  4013. above.
  4014.  
  4015. How can I find such an error. The program also run nicely on a Mac
  4016. IIci.
  4017.  
  4018. I'm greatful for all kind of help to solve this problem.
  4019.  
  4020.          - Jan
  4021.  
  4022. ----------------------------------------------------------------------
  4023.  From:    jaha@secrc.abb.se  Jan R. M. Rohman                          !
  4024.  Phone:    +46 21 32 31 48       ABB Corporate Research Center Dept. KF    !
  4025.  Fax:    +46 21 32 31 01       Department of Computational Methods,      !
  4026.                            Electromagnetic Fields and Fluid Dynamics !
  4027.                            S-721 78 Vasteras, SWEDEN                 !
  4028.  Home:   Vasagatan 35, 722 15 Vasteras, Phone:  +46 21 83 06 00      !
  4029. ----------------------------------------------------------------------
  4030. 
  4031. 
  4032. Path: ucivax!gateway
  4033. From: idowell@bbn.com
  4034. Subject: Line Width and Position
  4035. Message-ID: <9403290701.aa08707@q2.ics.uci.edu>
  4036. Newsgroups: fa.think-c
  4037. X-Message-ID: <9403290701.aa08707@q2.ics.uci.edu>
  4038. Approved: usenet@q2.ics.uci.edu
  4039. Lines: 14
  4040. Date: 29 Mar 94 15:01:49 GMT
  4041.  
  4042. Let's say I'm drawing a line on a graph using LineTo.
  4043. If the PenSize is (1,1) everything is fine, x=y passes
  4044. through the origin.  If I increase the PenSize to (8,8)
  4045. then only _one edge_ (not the center) of the line passes
  4046. through the origin.  Is there a way to specify where the
  4047. extra width goes (a la Photoshop)?  Or do I manually have
  4048. to calculate an offset?
  4049.  
  4050. Thanks!
  4051. Ian
  4052.  
  4053. ------------------------------------------------------------------------
  4054. Ian Dowell            Bolt, Beranek & Newman, Cambridge, MA
  4055. idowell@bbn.com       (617) 873-2673
  4056. 
  4057. 
  4058. Path: ucivax!gateway
  4059. From: canna@bga.com (Canna Software Development)
  4060. Subject: Forcing a window to be on top of all windows
  4061. Message-ID: <9403290725.aa09740@q2.ics.uci.edu>
  4062. X-Mailer: ELM [version 2.4 PL23]
  4063. Content-Type: text
  4064. Content-Length: 661
  4065. Newsgroups: fa.think-c
  4066. X-Message-ID: <199403291525.AA25809@zoom.bga.com>
  4067. Approved: usenet@q2.ics.uci.edu
  4068. Lines: 14
  4069. Date: 29 Mar 94 15:25:27 GMT
  4070.  
  4071. I have a client who is interested in having a tool palette on top of an
  4072. already existing application (read a commercial application).  Their
  4073. requirement is that the tool palette be visible at all times - otherwise
  4074. I would use the tool palette that is available in QuicKeys. Any suggestions?
  4075.  
  4076. Lloyd
  4077.  
  4078. ----------------------------+------------------------------------
  4079. Lloyd Sargent               | "Podia est gamia" - Sherlock Holmes
  4080. President                   | Internet:  canna@bga.com
  4081. Canna Software Development  | AOL:       lgsargent@aol.com
  4082. /        this space        \| Phone:     (512) 243-0283
  4083. \ intentionally left blank /| Fax:       (512) 243-0283
  4084.  
  4085. 
  4086. 
  4087. Path: ucivax!gateway
  4088. From: canna@bga.com (Canna Software Development)
  4089. Subject: SourceServer won't give me back my files!
  4090. Message-ID: <9403290739.aa10224@q2.ics.uci.edu>
  4091. X-Mailer: ELM [version 2.4 PL23]
  4092. Content-Type: text
  4093. Content-Length: 1589
  4094. Newsgroups: fa.think-c
  4095. X-Message-ID: <199403291539.AA26231@zoom.bga.com>
  4096. Approved: usenet@q2.ics.uci.edu
  4097. Lines: 39
  4098. Date: 29 Mar 94 15:39:22 GMT
  4099.  
  4100. Actually, I am having several problems with SourceServer at the moment.
  4101. If anyone can solve my problems, I will be eternally (or at least for the
  4102. next week) in your debt!
  4103.  
  4104. 1) I open a project, start SourceServer, open the database, attempt to
  4105. check out my file and get the following:
  4106.  
  4107. ### NameRevisions - The "-u" option requires a parameter.
  4108. # Usage - NameRevisions [-u User] [-project Project] [-public | -private
  4109. | -b] [-r]
  4110.         [[-only] | name [[-expand] [-s] | [-replace] [-dynamic]
  4111. [namesI | -a]]]
  4112.  
  4113. Well, my first reaction was "THAT IS NOT WHAT I TOLD YOU TO DO!". My
  4114. second was, why in the heck is it doing this?
  4115.  
  4116. I had had it working fine, BUT one thing has transpired since I last used
  4117. SourceServer -- I installed System 7 Pro. Could it be upset that I
  4118. haven't got the networking stuff set up right (names and what not?).
  4119.  
  4120. 2) Supposedly you can access SourceServer using an emply file in the
  4121. editor, selecting the command and type <control><return>. Well, it does
  4122. nothing when I do that. Zip. Could it have something to do with the
  4123. previous problem?
  4124.  
  4125. Thanks in advance for all who are able to give me advice!
  4126.  
  4127. Lloyd
  4128.  
  4129. P.S. Where are some good documents for writing code for MacTCP? Examples
  4130. would also be nice!
  4131.  
  4132. ----------------------------+------------------------------------
  4133. Lloyd Sargent               | "Podia est gamia" - Sherlock Holmes
  4134. President                   | Internet:  canna@bga.com
  4135. Canna Software Development  | AOL:       lgsargent@aol.com
  4136. /        this space        \| Phone:     (512) 243-0283
  4137. \ intentionally left blank /| Fax:       (512) 243-0283
  4138.  
  4139. 
  4140. 
  4141. Path: ucivax!gateway
  4142. From: nagel@ics.uci.edu (Mark Nagel)
  4143. Subject: ADMIN: List Disruption This Weekend
  4144. Message-ID: <9403291141.aa24859@q2.ics.uci.edu>
  4145. Newsgroups: fa.think-c
  4146. Reply-To: nagel@ics.uci.edu
  4147. X-Message-ID: <24855.764970083@ics.uci.edu>
  4148. Approved: usenet@q2.ics.uci.edu
  4149. Lines: 6
  4150. Date: 29 Mar 94 19:41:34 GMT
  4151.  
  4152. Apparently the entire campus of UC Irvine will be undergoing a power
  4153. outage from this Friday evening (4/1) through the following Monday
  4154. morning (4/4).  During this time the mailing list and archives will
  4155. be inaccessible.
  4156.  
  4157. Mark "very grateful for not living on campus any longer"
  4158. 
  4159. 
  4160. Path: ucivax!gateway
  4161. From: eldred@rrunner.jpl.nasa.gov (Dan Eldred)
  4162. Subject: Find under project manager
  4163. Message-ID: <9403291144.aa25029@q2.ics.uci.edu>
  4164. Newsgroups: fa.think-c
  4165. X-Message-ID: <9403291944.AA01761@rrunner.jpl.nasa.gov>
  4166. Approved: usenet@q2.ics.uci.edu
  4167. Lines: 11
  4168. Date: 29 Mar 94 19:44:24 GMT
  4169.  
  4170.  
  4171. The multi-file search option under find will search through
  4172. all the include files if they are #included from the C programs
  4173. which are in the current project.  But if an include file
  4174. #includes another include file, then the second include file
  4175. is not searched.
  4176.  
  4177. Any way around this?  I'm having to use a standalone port
  4178. of egrep right now?
  4179.  
  4180.     - Dan Eldred        eldred@rrunner.jpl.nasa.gov
  4181. 
  4182. 
  4183. Path: ucivax!gateway
  4184. From: de19@umail.umd.edu (Dana S Emery)
  4185. Subject: Re: Line Width and Position
  4186. Message-ID: <9403291759.aa15994@q2.ics.uci.edu>
  4187. In-Reply-To: Your message <9403290701.aa08707@q2.ics.uci.edu> of 29 Mar 94
  4188.  15:01:49 GMT
  4189. Content-Type: TEXT/plain; charset=US-ASCII
  4190. Newsgroups: fa.think-c
  4191. X-Message-ID: <Mailstrom.1.03.18202.9528.de19@umail.umd.edu>
  4192. Approved: usenet@q2.ics.uci.edu
  4193. Lines: 23
  4194. Date: 30 Mar 94 01:59:23 GMT
  4195.  
  4196. >   If I increase the PenSize to (8,8) then only _one edge_
  4197. >   (not the center) of the line passes through the origin.
  4198.  
  4199. That is due to the design of the QD imaging system, which is
  4200. discussed in IM:1 (qv), lord only knows what volume of the NIM
  4201. series covers it, perhaps in the overview volume or in the
  4202. long awaited (recently ?released) Imaging:QD volume.
  4203.  
  4204. The essence of it is: the pen dangles down and to the right
  4205. of its top-left corner, which is the locus of the current point.
  4206.  
  4207. Other imaging systems do it differently, notably Postscript.
  4208. In PS, a path has no width while it is being created, only when
  4209. it is stroked does the pen width come into use, at which time
  4210. the path defines the center of the pen, thus half of the pen
  4211. slops over onto each side of the path coloring pixels as it goes.
  4212.  
  4213. Thus, to convert locations from a QD framework to a PS one you must
  4214. consider line direction and width, so that an appropriate fraction
  4215. of the pen width can be added/subtracted to x and/or y.
  4216. --
  4217. dana s emery <de19@umail.umd.edu>
  4218.  
  4219. 
  4220. 
  4221. Path: ucivax!gateway
  4222. From: canna@bga.com (Canna Software Development)
  4223. Subject: Windows on top of all other windows...
  4224. Message-ID: <9403300917.aa05312@q2.ics.uci.edu>
  4225. X-Mailer: ELM [version 2.4 PL23]
  4226. Content-Type: text
  4227. Content-Length: 1870
  4228. Newsgroups: fa.think-c
  4229. X-Message-ID: <199403301716.AA29520@zoom.bga.com>
  4230. Approved: usenet@q2.ics.uci.edu
  4231. Lines: 39
  4232. Date: 30 Mar 94 17:17:32 GMT
  4233.  
  4234. >Write a desk accessory and stash it inside the application resource
  4235. >fork. To see if this wll be satisfactory, pick any small DA as an
  4236. >experimental test subject, install it into the app with Font/DA Mover
  4237. >(hold the option key down when clicking the "open" button), and show it
  4238. >to the client.
  4239. >
  4240. > Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  4241.  
  4242. Couple of problems with this solution:
  4243.   1) Client (and myself) are running System 7 Pro, so I had to hunt up an
  4244. old copy of Font/DA Mover (which wouldn't run - so I changed the creator
  4245. in order to 'fool' System 7 Pro). I was lucky I hadn't pitched the 6.0.x
  4246. disks.
  4247.   2) Using both an old DA of Puzzle (as well as the System 7 Pro), I got
  4248. a window (the puzzle), but it did NOT stay on top of the application's
  4249. windows.
  4250.   3) The DA showed up in the Apple Menu list. I hate to think what
  4251. would/could happen if it was selected (probably nothing disasterous, most
  4252. likely it would 'select' the window (the one that should have stayed on TOP).
  4253.  
  4254. This was an interesting idea and the results were interesting, but it
  4255. does little to solve my clients needs. Thanks for the input, though.
  4256.  
  4257. So, the problem still remains.  Is there a method to keep a window on top
  4258. of all other windows? Windows 3.1 has the capability (do NOT interpret
  4259. this as the start of a flame war - I only want to solve my client's
  4260. problem and am well aware of the strengths/weaknesses of PC vs. Mac),
  4261. surely it is possible to do it on the Mac!
  4262.  
  4263. Thanks again in advance,
  4264.  
  4265. Lloyd
  4266.  
  4267. ----------------------------+------------------------------------
  4268. Lloyd Sargent               | "Podia est gamia" - Sherlock Holmes
  4269. President                   | Internet:  canna@bga.com
  4270. Canna Software Development  | AOL:       lgsargent@aol.com
  4271. /        this space        \| Phone:     (512) 243-0283
  4272. \ intentionally left blank /| Fax:       (512) 243-0283
  4273. 
  4274. 
  4275. Path: ucivax!gateway
  4276. From: chrism@corp.cirrus.com (Chris Metcalfe)
  4277. Subject: Re:  Windows on top of all other windows...
  4278. Message-ID: <9403301037.aa11350@q2.ics.uci.edu>
  4279. Newsgroups: fa.think-c
  4280. X-Message-ID: <9403301837.AA19423@tango.corp.cirrus.com>
  4281. Approved: usenet@q2.ics.uci.edu
  4282. Lines: 8
  4283. Date: 30 Mar 94 18:37:53 GMT
  4284.  
  4285. The Text Manager of System 7 has a utility window "layer"
  4286. that stays in front of all other windows.  This was meant to
  4287. be used for multiple language environments, where you are typing
  4288. in a little bit of Japanese for insertion into an English
  4289. document, etc.  It's covered in the new Inside Macintosh, "Text."
  4290.  
  4291. -- Chris Metcalfe
  4292.  
  4293. 
  4294. 
  4295. Path: ucivax!gateway
  4296. From: pindar3@cix.compulink.co.uk (Pindar Infotek Ltd)
  4297. Subject: Windows on top - Ghostwindo
  4298. Message-ID: <9403310352.aa01739@q2.ics.uci.edu>
  4299. Newsgroups: fa.think-c
  4300. Reply-To: pindar3@cix.compulink.co.uk
  4301. X-Message-ID: <memo.780537@cix.compulink.co.uk>
  4302. Approved: usenet@q2.ics.uci.edu
  4303. Lines: 22
  4304. Date: 31 Mar 94 11:52:18 GMT
  4305.  
  4306.  
  4307. From Pindar user Ian McCall
  4308.  
  4309. Subject: _Windows on top - Ghostwindow
  4310. I've never used this myself, but if you set the low memory global
  4311. GhostWindow to point to your window, you should guarantee that no
  4312. other window goes above yours. I think the way to hide it is to
  4313. CloseWindow following an app4/osEvt.
  4314.  
  4315. As I say, I've never done this myself. Maybe if someone has they
  4316. could post and give more accurate information?
  4317.  
  4318.  
  4319. Cheers,
  4320.       Ian
  4321.  
  4322.  
  4323.  
  4324. ---
  4325. Please make 'Attn:<space>Ian McCall' the first line of your reply
  4326. (not the subject) to ensure automatic forwarding to the correct
  4327. Pindar user.
  4328. 
  4329. 
  4330. Path: ucivax!gateway
  4331. From: inei@dcs.gla.ac.uk (inei)
  4332. Subject: Whereis Movies.h
  4333. Message-ID: <9403310633.aa20003@q2.ics.uci.edu>
  4334. Newsgroups: fa.think-c
  4335. X-Message-ID: <9403311432.AA25612@hawaii.dcs.gla.ac.uk>
  4336. Approved: usenet@q2.ics.uci.edu
  4337. Lines: 6
  4338. Date: 31 Mar 94 14:33:35 GMT
  4339.  
  4340.  
  4341. Can anyone tell me where is the header file Movies.h?  I seem to recall
  4342. reading something about it a while ago, but I can't find it now.  Any
  4343. help appreciated.  Thank you.
  4344.  
  4345. Nick.
  4346. 
  4347. 
  4348. Path: ucivax!gateway
  4349. From: tla@crl.com (Troy Anderson)
  4350. Subject: Re: Forcing a window to be on top of all windows
  4351. Message-ID: <9403311219.aa08244@q2.ics.uci.edu>
  4352. In-Reply-To: <9403290725.aa09740@q2.ics.uci.edu>
  4353. Content-Type: TEXT/PLAIN; charset=US-ASCII
  4354. Mime-Version: 1.0
  4355. Newsgroups: fa.think-c
  4356. X-Message-ID: <Pine.3.87.9403311240.A25155-0100000@crl.crl.com>
  4357. Approved: usenet@q2.ics.uci.edu
  4358. Lines: 14
  4359. Date: 31 Mar 94 20:19:03 GMT
  4360.  
  4361. I haven't taken this exact approach, but I suspect you could write an
  4362. Extension that detects when that application is being launched and patch
  4363. NewWindow, ShowWindow, HideWindow, etc. in that application's heap so
  4364. that you can massage the window list before the toolbox has its chance to
  4365. do its thing.  It would be rather involved, but is possible.  I wrote
  4366. MarkerControl that is an extension that detects when THINK C is launched,
  4367. so I know that is possibe.  To see what things to patch, just look at the
  4368. Think Class Library and see how they implement their floating window
  4369. stuff.  They do it in the application, but you could probably do the same
  4370. thing via patched.
  4371.  
  4372. Good luck,
  4373. Troy Anderson
  4374.  
  4375. 
  4376.